diff options
| author | Calvin Johnson <calvin.johnson@oss.nxp.com> | 2022-06-13 12:01:19 +0530 |
|---|---|---|
| committer | Vignesh Raghavendra <vigneshr@ti.com> | 2022-06-14 20:39:18 +0530 |
| commit | 50dc7ad9dbb129ea6f1d5cb04b7c5b88b770c1e4 (patch) | |
| tree | a57a0c3bbbf7ab2e728c7a770888fb0d91c13366 /include/linux | |
| parent | dab9d89bd76d0b093416624d94504fcc3ce8190b (diff) | |
net: phy: Introduce fwnode_get_phy_id()
commit 114dea60043b8f0c82c67dd281719ef8919c2416 upstream.
Extract phy_id from compatible string. This will be used by
fwnode_mdiobus_register_phy() to create phy device using the
phy_id.
Signed-off-by: Calvin Johnson <calvin.johnson@oss.nxp.com>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Acked-by: Grant Likely <grant.likely@arm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/phy.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h index 7c5ae33e012e..cb632aa67fbb 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1400,6 +1400,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, u32 phy_id, bool is_c45, struct phy_c45_device_ids *c45_ids); #if IS_ENABLED(CONFIG_PHYLIB) +int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id); struct mdio_device *fwnode_mdio_find_device(struct fwnode_handle *fwnode); struct phy_device *fwnode_phy_find_device(struct fwnode_handle *phy_fwnode); struct phy_device *device_phy_find_device(struct device *dev); @@ -1408,6 +1409,10 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45); int phy_device_register(struct phy_device *phy); void phy_device_free(struct phy_device *phydev); #else +static inline int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id) +{ + return 0; +} static inline struct mdio_device *fwnode_mdio_find_device(struct fwnode_handle *fwnode) { |
