]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drivers/of/of_mdio.c:fix of_mdiobus_register()
authorDajun Jin <adajunjin@gmail.com>
Tue, 3 Mar 2020 04:24:21 +0000 (20:24 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Mar 2020 03:01:51 +0000 (19:01 -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>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/of/of_mdio.c

index 8270bbf505fbe4d873b7a67d17ffc07daeac3da6..9f982c0627a0d1bab11f11c775e778f58a7902bc 100644 (file)
@@ -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;
                        }
                }
        }