]> git.ipfire.org Git - thirdparty/kernel/stable.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 08:59:57 +0000 (10:59 +0200)
[ 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 <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 fc757ef6eadc527b96efb8001dbe856364aac3a0..a27234c58ec5636886f459d597ccaa73dfb5de60 100644 (file)
@@ -269,6 +269,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;
                        }
                }
        }