[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230610161308.3158-1-zhaojh329@gmail.com>
Date: Sun, 11 Jun 2023 00:13:08 +0800
From: Jianhui Zhao <zhaojh329@...il.com>
To: andrew@...n.ch, hkallweit1@...il.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Jianhui Zhao <zhaojh329@...il.com>
Subject: [PATCH] net: mdio: fix duplicate registrations for phy with c45 in __of_mdiobus_register()
Maybe mdiobus_scan_bus_c45() is called in __mdiobus_register().
Thus it should skip already registered PHYs later.
Signed-off-by: Jianhui Zhao <zhaojh329@...il.com>
---
drivers/net/mdio/of_mdio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 7eb32ebb846d..441973fce79e 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -186,6 +186,10 @@ int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np,
continue;
}
+ /* skip already registered PHYs */
+ if (mdiobus_is_registered_device(mdio, addr))
+ continue;
+
if (of_mdiobus_child_is_phy(child))
rc = of_mdiobus_register_phy(mdio, child, addr);
else
--
2.34.1
Powered by blists - more mailing lists