[PATCH v1 1/8] mdio_bus: do reset only on PHY devices

Oleksij Rempel o.rempel at pengutronix.de
Mon Sep 26 01:17:33 PDT 2022


Do not reset MDIO devices. Device drivers should handle it.

Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
---
 drivers/net/phy/mdio_bus.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
index f06ab68f50..a68b0e47c0 100644
--- a/drivers/net/phy/mdio_bus.c
+++ b/drivers/net/phy/mdio_bus.c
@@ -263,12 +263,13 @@ static int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
 		}
 
 		of_pinctrl_select_state_default(child);
-		of_mdiobus_reset_phy(mdio, child);
 
-		if (of_mdiobus_child_is_phy(child))
+		if (of_mdiobus_child_is_phy(child)) {
+			of_mdiobus_reset_phy(mdio, child);
 			of_mdiobus_register_phy(mdio, child, addr);
-		else
+		} else {
 			of_mdiobus_register_device(mdio, child, addr);
+		}
 	}
 
 	return 0;
-- 
2.30.2




More information about the barebox mailing list