There is a need to fill node before clk_output_sel is setup.

Signed-off-by: Michal Simek <michal.si...@xilinx.com>
Acked-by: Siva Durga Prasad Paladugu <siva.durga.palad...@xilinx.com>
---

 drivers/net/phy/ti.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c
index 6db6edd0d0c8..10989dd40309 100644
--- a/drivers/net/phy/ti.c
+++ b/drivers/net/phy/ti.c
@@ -216,6 +216,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
@@ -225,10 +229,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"))
-- 
1.9.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to