Skip to content

Commit 2d7b8bf

Browse files
calvinjolinuxdavem330
authored andcommitted
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>
1 parent 425775e commit 2d7b8bf

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

drivers/net/mdio/of_mdio.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -360,18 +360,7 @@ EXPORT_SYMBOL(of_mdio_find_device);
360360
*/
361361
struct phy_device *of_phy_find_device(struct device_node *phy_np)
362362
{
363-
struct mdio_device *mdiodev;
364-
365-
mdiodev = of_mdio_find_device(phy_np);
366-
if (!mdiodev)
367-
return NULL;
368-
369-
if (mdiodev->flags & MDIO_DEVICE_FLAG_PHY)
370-
return to_phy_device(&mdiodev->dev);
371-
372-
put_device(&mdiodev->dev);
373-
374-
return NULL;
363+
return fwnode_phy_find_device(of_fwnode_handle(phy_np));
375364
}
376365
EXPORT_SYMBOL(of_phy_find_device);
377366

0 commit comments

Comments
 (0)