diff options
author | Marek BehĂșn | 2022-04-07 00:33:08 +0200 |
---|---|---|
committer | Ramon Fried | 2022-04-10 08:44:13 +0300 |
commit | e24b58f5ed4f9a0b5b1c80a5f35aa71fcad7f233 (patch) | |
tree | cb51b913a077436d179a8a5ad5547c876320f525 /include/exports.h | |
parent | b638814e91f772beb1c05e4d04cf6513ac37af59 (diff) |
net: phy: don't require PHY interface mode during PHY creation
Currently we require PHY interface mode to be known when
finding/creating the PHY - the functions
* phy_connect_phy_id()
* phy_device_create()
* create_phy_by_mask()
* search_for_existing_phy()
* get_phy_device_by_mask()
* phy_find_by_mask()
all require the interface parameter, but the only thing done with it is
that it is assigned to phydev->interface.
This makes it impossible to find a PHY device without overwriting the
set mode.
Since the interface mode is not used during .probe() and should be used
at first in .config(), drop the interface parameter from these
functions. Make the default value of phydev->interface (in
phy_device_create()) to be PHY_INTERFACE_MODE_NA. Move the interface
parameter to phy_connect_dev(), where it should be.
Change all occurrences treewide. In occurrences where we don't call
phy_connect_dev() for some reason (they only configure the PHY without
connecting it to an ethernet controller), set
phydev->interface = value from phy_find_by_mask call.
Signed-off-by: Marek BehĂșn <marek.behun@nic.cz>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Diffstat (limited to 'include/exports.h')
-rw-r--r-- | include/exports.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/exports.h b/include/exports.h index 550cafdc7a1..6f8c9cf4517 100644 --- a/include/exports.h +++ b/include/exports.h @@ -55,8 +55,7 @@ int i2c_read (uchar, uint, int , uchar* , int); #endif #ifdef CONFIG_PHY_AQUANTIA struct mii_dev *mdio_get_current_dev(void); -struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask, - phy_interface_t interface); +struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask); struct phy_device *mdio_phydev_for_ethname(const char *ethname); int miiphy_set_current_dev(const char *devname); #endif |