net: stmmac: Don't search for phys if mdio node is defined.
authorPhil Reid <preid@electromag.com.au>
Tue, 15 Mar 2016 07:34:33 +0000 (15:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Mar 2016 22:29:23 +0000 (18:29 -0400)
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>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c

index efb54f356a67c03e36856ed0047f5e3d9b2bf0f1..ea76129dafc2bc6e6e0d602bb1da9a66b39810e1 100644 (file)
@@ -243,6 +243,9 @@ int stmmac_mdio_register(struct net_device *ndev)
                goto bus_register_fail;
        }
 
+       if (priv->plat->phy_node || mdio_node)
+               goto bus_register_done;
+
        found = 0;
        for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
                struct phy_device *phydev = mdiobus_get_phy(new_bus, addr);
@@ -298,6 +301,7 @@ int stmmac_mdio_register(struct net_device *ndev)
                return -ENODEV;
        }
 
+bus_register_done:
        priv->mii = new_bus;
 
        return 0;