From: Dajun Jin Date: Tue, 3 Mar 2020 04:24:21 +0000 (-0800) Subject: drivers/of/of_mdio.c:fix of_mdiobus_register() X-Git-Tag: v4.14.175~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06bd8b3078947d5d9ba9f0ccee8335a62f59b414;p=thirdparty%2Fkernel%2Fstable.git drivers/of/of_mdio.c:fix of_mdiobus_register() [ Upstream commit 209c65b61d94344522c41a83cd6ce51aac5fd0a4 ] When registers a phy_device successful, should terminate the loop or the phy_device would be registered in other addr. If there are multiple PHYs without reg properties, it will go wrong. Signed-off-by: Dajun Jin Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index fe26697d3bd72..69da2f6896dae 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -259,6 +259,7 @@ int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) rc = of_mdiobus_register_phy(mdio, child, addr); if (rc && rc != -ENODEV) goto unregister; + break; } } }