summaryrefslogtreecommitdiff
path: root/drivers/net/mdio
diff options
context:
space:
mode:
authorCalvin Johnson <calvin.johnson@oss.nxp.com>2021-06-11 13:53:50 +0300
committerDavid S. Miller <davem@davemloft.net>2021-06-11 13:08:52 -0700
commit2d7b8bf1fa7afab77f106b67ec6e3d524e3745ca (patch)
treec4c9667b5043ca5ff393590119a747b288cf0e4f /drivers/net/mdio
parent425775ed31a6fac8b66ab077f7936fafad895ef6 (diff)
of: mdio: Refactor of_phy_find_device()
Refactor of_phy_find_device() to use fwnode_phy_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.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 6ef8b6e40189..0ba1158796d9 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -360,18 +360,7 @@ EXPORT_SYMBOL(of_mdio_find_device);
*/
struct phy_device *of_phy_find_device(struct device_node *phy_np)
{
- struct mdio_device *mdiodev;
-
- mdiodev = of_mdio_find_device(phy_np);
- if (!mdiodev)
- return NULL;
-
- if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY)
- return to_phy_device(&mdiodev->dev);
-
- put_device(&mdiodev->dev);
-
- return NULL;
+ return fwnode_phy_find_device(of_fwnode_handle(phy_np));
}
EXPORT_SYMBOL(of_phy_find_device);