]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Apr 2020 09:01:51 +0000 (11:01 +0200)
[ Upstream commit 054e388ef1df38ab4365ebc89accc00a6c3f9b3d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/of/of_mdio.c

index bd6129db641782c653b14c56dcb887d47124ad51..c34a6df712adb358de92e823fd6a06c19de97e25 100644 (file)
@@ -268,6 +268,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;
                        }
                }
        }