diff options
author | Calvin Johnson <calvin.johnson@oss.nxp.com> | 2021-06-11 13:53:48 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-06-11 13:08:52 -0700 |
commit | 0fb16976765143cf0d7d0dd78b3f406ab135c494 (patch) | |
tree | e0e3029a416177831727ef327e7d9d70ef917820 /drivers/net/mdio | |
parent | e71305acd81cac222c41849e538c5c661b12c584 (diff) |
net: phy: Introduce fwnode_mdio_find_device()
Define fwnode_mdio_find_device() to get a pointer to the
mdio_device from fwnode passed to the function.
Refactor of_mdio_find_device() to use fwnode_mdio_find_device().
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>
Diffstat (limited to 'drivers/net/mdio')
-rw-r--r-- | drivers/net/mdio/of_mdio.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c index 8e97d5b825f5..6ef8b6e40189 100644 --- a/drivers/net/mdio/of_mdio.c +++ b/drivers/net/mdio/of_mdio.c @@ -347,16 +347,7 @@ EXPORT_SYMBOL(of_mdiobus_register); */ struct mdio_device *of_mdio_find_device(struct device_node *np) { - struct device *d; - - if (!np) - return NULL; - - d = bus_find_device_by_of_node(&mdio_bus_type, np); - if (!d) - return NULL; - - return to_mdio_device(d); + return fwnode_mdio_find_device(of_fwnode_handle(np)); } EXPORT_SYMBOL(of_mdio_find_device); |