diff mbox series

drivers/of/of_mdio.c:fix of_mdiobus_register()

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

Commit Message

Dajun Jin March 3, 2020, 4:24 a.m. UTC
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(+)

Comments

Andrew Lunn March 3, 2020, 10:02 p.m. UTC | #1
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
David Miller March 4, 2020, 3:02 a.m. UTC | #2
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 mbox series

Patch

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;
 			}
 		}
 	}