Re: [PATCH 04/10] regulator: of: switch to using class_find_device_by_fwnode()

From: Dmitry Torokhov

Date: Mon Mar 23 2026 - 15:03:38 EST


On Mon, Mar 23, 2026 at 02:00:43PM +0000, Mark Brown wrote:
> On Sun, Mar 22, 2026 at 06:54:22PM -0700, Dmitry Torokhov wrote:
> > In preparation to class_find_device_by_of_node() going away switch to
> > using class_find_device_by_fwnode().
>
> > struct device *dev;
> >
> > - dev = class_find_device_by_of_node(&regulator_class, np);
> > + dev = class_find_device_by_fwnode(&regulator_class, of_fwnode_handle(np));
>
> The regulator API is very deliberately specifically using the OF APIs,
> not the ACPI APIs, since ACPI really doesn't want to model regulators.

For now? We also have software nodes and maybe we come up with something
else in the future...

I think we should use firmware-agnostic APIs as much as possible, and
only use OF- or ACPI-specific ones when there is no generic equivalent.
This makes the code most flexible.

Anyway, I am not proposing to change all of the regulator code, just
clean up driver core APIs.

Thanks.

--
Dmitry