A net_device only needs at most one phydev, There is no need
to recycle the entire list after finding a phydev.
Signed-off-by: xiaolinkui <redacted>
---
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index cfe5d8b73142..6fb87cc18d65 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -431,6 +431,9 @@ int stmmac_mdio_register(struct net_device *ndev)
phy_attached_info(phydev);
found = 1;
+
+ if (phydev->phy_id != 0)
+ goto bus_register_done;
}
if (!found && !mdio_node) {--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel