From b8d7ec782f3b969d828831359411203adfc20dd0 Mon Sep 17 00:00:00 2001 From: Grygorii Strashko Date: Thu, 5 Jul 2018 12:02:49 -0500 Subject: [PATCH] net: phy: dp83867: switch to use phy_get_ofnode() Use PHY API phy_get_ofnode() helper to get PHY DT node. Signed-off-by: Grygorii Strashko Acked-by: Joe Hershberger Tested-by: Siva Durga Prasad Paladugu --- drivers/net/phy/ti.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c index 655f46d22f..f870e6d662 100644 --- a/drivers/net/phy/ti.c +++ b/drivers/net/phy/ti.c @@ -172,8 +172,11 @@ void phy_write_mmd_indirect(struct phy_device *phydev, int prtad, static int dp83867_of_init(struct phy_device *phydev) { struct dp83867_private *dp83867 = phydev->priv; - struct udevice *dev = phydev->dev; - ofnode node = dev_ofnode(dev); + ofnode node; + + node = phy_get_ofnode(phydev); + if (!ofnode_valid(node)) + return -EINVAL; if (ofnode_read_bool(node, "ti,max-output-impedance")) dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX; -- 2.39.5