summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2019-03-16 12:43:17 +0100
committerJoe Hershberger <joe.hershberger@ni.com>2019-05-14 14:43:33 -0500
commit6845b368f17e7bfb7f6d683cfd4e0faa75877145 (patch)
tree333f6cd9538cd11158e968808a0a7d31d0096deb /drivers/net
parent77b508d34b9485c981b084e8169dd64b381935b6 (diff)
phy: ti: Init node before reading
There is a need to fill node before clk_output_sel is setup. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com> Reviewed-by: <hannes.schmelzer@br-automation.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/ti.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/phy/ti.c b/drivers/net/phy/ti.c
index 6ac890a7f5..25f1332ca9 100644
--- a/drivers/net/phy/ti.c
+++ b/drivers/net/phy/ti.c
@@ -138,6 +138,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
@@ -147,10 +151,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"))