aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2016-03-15 03:34:33 -0400
committerDavid S. Miller <davem@davemloft.net>2016-03-18 18:29:23 -0400
commitcc2fa619a738a052eb90ccbbbc48947a2e2aa1d3 (patch)
tree2c0ec8b1a3fed9a3876dd55e8f6283a70d37d499
parent48e77422a3cb74e04384090e21235f4916278373 (diff)
net: stmmac: Don't search for phys if mdio node is defined.
If a dt mdio entry has been added least assume that we wont search for phys attached. The DT and of_mdiobus_register already do this. This stops DSA phys being found and phys created for them, as this is handled by the DSA driver. Signed-off-by: Phil Reid <preid@electromag.com.au> Acked-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index efb54f356a67..ea76129dafc2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -243,6 +243,9 @@ int stmmac_mdio_register(struct net_device *ndev)
243 goto bus_register_fail; 243 goto bus_register_fail;
244 } 244 }
245 245
246 if (priv->plat->phy_node || mdio_node)
247 goto bus_register_done;
248
246 found = 0; 249 found = 0;
247 for (addr = 0; addr < PHY_MAX_ADDR; addr++) { 250 for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
248 struct phy_device *phydev = mdiobus_get_phy(new_bus, addr); 251 struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
@@ -298,6 +301,7 @@ int stmmac_mdio_register(struct net_device *ndev)
298 return -ENODEV; 301 return -ENODEV;
299 } 302 }
300 303
304bus_register_done:
301 priv->mii = new_bus; 305 priv->mii = new_bus;
302 306
303 return 0; 307 return 0;