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

From: Dmitry Torokhov

Date: Mon Mar 23 2026 - 01:18:03 EST


On Mon, Mar 23, 2026 at 03:54:09AM +0100, Andrew Lunn wrote:
> > - 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));
>
> When you look at this, why is it better?

I think we should move as much as possible towards firmware-agnostic
APIs and use fwnode_handle instead of device_node or software_node or
ACPI companion. To discourage this I think we better remove
firmware-specific APIs where we have firmware-agnostic ones and
eventually clean up drivers that use OF- or ACPI-specific APIs.

Thanks.

--
Dmitry