[PATCH net-next 07/10] net: phy: switch to using class_find_device_by_fwnode()

Dmitry Torokhov dmitry.torokhov at gmail.com
Sun Mar 22 18:54:25 PDT 2026


In preparation to class_find_device_by_of_node() going away switch to
using class_find_device_by_fwnode().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov at gmail.com>
---
 drivers/net/phy/mdio_bus_provider.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mdio_bus_provider.c b/drivers/net/phy/mdio_bus_provider.c
index 041576eba47a..ed3cd9a37c67 100644
--- a/drivers/net/phy/mdio_bus_provider.c
+++ b/drivers/net/phy/mdio_bus_provider.c
@@ -21,6 +21,7 @@
 #include <linux/mii.h>
 #include <linux/mm.h>
 #include <linux/netdevice.h>
+#include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_mdio.h>
 #include <linux/phy.h>
@@ -754,7 +755,8 @@ struct mii_bus *of_mdio_find_bus(struct device_node *mdio_bus_np)
 	if (!mdio_bus_np)
 		return NULL;
 
-	d = class_find_device_by_of_node(&mdio_bus_class, mdio_bus_np);
+	d = class_find_device_by_fwnode(&mdio_bus_class,
+					of_fwnode_handle(mdio_bus_np));
 	return d ? to_mii_bus(d) : NULL;
 }
 EXPORT_SYMBOL(of_mdio_find_bus);

-- 
2.53.0.959.g497ff81fa9-goog




More information about the linux-phy mailing list