From: Michal Simek Date: Sat, 16 Mar 2019 11:02:57 +0000 (+0100) Subject: phy: ti: Init node before reading X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=602f217c499332778babc87af7e93b1c26059cee;p=thirdparty%2Fu-boot.git phy: ti: Init node before reading There is a need to fill node before clk_output_sel is setup. Signed-off-by: Michal Simek Acked-by: Siva Durga Prasad Paladugu --- diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c index 16702bc4d05..97b729e11cd 100644 --- a/drivers/net/phy/ti.c +++ b/drivers/net/phy/ti.c @@ -220,6 +220,10 @@ static int dp83867_of_init(struct phy_device *phydev) /* Optional configuration */ + node = phy_get_ofnode(phydev); + if (!ofnode_valid(node)) + return -EINVAL; + /* * Keep the default value if ti,clk-output-sel is not set * or to high @@ -229,10 +233,6 @@ static int dp83867_of_init(struct phy_device *phydev) ofnode_read_u32_default(node, "ti,clk-output-sel", DP83867_CLK_O_SEL_REF_CLK); - 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; else if (ofnode_read_bool(node, "ti,min-output-impedance"))