Re: [PATCH] software node: allow referencing software nodes by name

From: Rafael J. Wysocki

Date: Tue Mar 31 2026 - 08:18:31 EST


On Thu, Mar 26, 2026 at 8:01 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> On Thu, Mar 26, 2026 at 04:47:00PM +0100, Bartosz Golaszewski wrote:
> > On Thu, Mar 26, 2026 at 9:48 AM Andy Shevchenko
> > <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > > On Thu, Mar 26, 2026 at 10:39:09AM +0200, Andy Shevchenko wrote:
> > > > On Thu, Mar 26, 2026 at 09:34:01AM +0100, Bartosz Golaszewski wrote:
>
> ...
>
> > > > I believe so. See how we find a GPIO chip in the gpiolib-acpi-core.c.
> > > > In the similar way you can try finding any object in ACPI namespace.
> > > >
> > > > But note, ":00" is part of device instance name, it's not available
> > > > in ACPI namespace. There we have HID, UID, et cetera, ":00" is pure
> > > > Linux kernel thingy.
> > >
> > > We have acpi_dev_present(), but if you read its kernel-doc, it suggests
> > > to use acpi_get_devices() for the case of early checks (before device
> > > are actually being instantiated).
> >
> > Ah, but I'm seeing that the firmware node handle of the acpi device is
> > part of struct acpi_device and is only initialized during the scanning
> > phase which happens at subsys_initcall() time?
>
> Sounds correct. With that you can just check the device presence in the table
> and maybe evaluate the status (but I'm not sure about the latter).

Yes, you can. _STA is available at that point.