Message ID | 20200303042421.23050-1-adajunjin@gmail.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | drivers/of/of_mdio.c:fix of_mdiobus_register() | expand |
On Mon, Mar 02, 2020 at 08:24:21PM -0800, Dajun Jin wrote: > 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 <adajunjin@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
From: Dajun Jin <adajunjin@gmail.com> Date: Mon, 2 Mar 2020 20:24:21 -0800 > 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 <adajunjin@gmail.com> Applied, thank you.
diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c index 8270bbf505fb..9f982c0627a0 100644 --- a/drivers/of/of_mdio.c +++ b/drivers/of/of_mdio.c @@ -306,6 +306,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; } } }
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 <adajunjin@gmail.com> --- Hi Andrew, Thanks for your review. drivers/of/of_mdio.c | 1 + 1 file changed, 1 insertion(+)