Commit 2d7b8bf1 authored by Calvin Johnson's avatar Calvin Johnson Committed by David S. Miller

of: mdio: Refactor of_phy_find_device()

Refactor of_phy_find_device() to use fwnode_phy_find_device().
Signed-off-by: default avatarCalvin Johnson <calvin.johnson@oss.nxp.com>
Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
Acked-by: default avatarGrant Likely <grant.likely@arm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 425775ed
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment