Re: [PATCH 04/10] regulator: of: switch to using class_find_device_by_fwnode()
Dmitry Torokhov <[email protected]> Mon, 23 Mar 2026 11:28:27 -0700
| Newsgroups | org.kernel.vger.linux-fpga,dev.linux.lists.driver-core,org.infradead.lists.linux-phy,org.kernel.vger.linux-kernel,org.kernel.vger.linux-leds,org.kernel.vger.linux-spi,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
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(®ulator_class, np); > > + dev = class_find_device_by_fwnode(®ulator_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