Re: [PATCH v1] PNP: ACPI: Stop using acpi_device_name()

From: Andy Shevchenko

Date: Wed Jul 08 2026 - 10:45:43 EST


On Mon, Jul 06, 2026 at 02:43:32PM +0200, Rafael J. Wysocki wrote:

> Since acpi_device_name() checked by pnpacpi_add_device() is never
> populated, its length is always zero and the codition checking it
> is always false.
>
> Accordingly, drop that condition and use acpi_device_bid(device) for
> setting dev->name in pnpacpi_add_device() unconditionally.
>
> No intentional functional impact.
>
> This will facilitate the removal of device_name from struct
> acpi_device_pnp in the future.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

...

> - if (strlen(acpi_device_name(device)))
> - strscpy(dev->name, acpi_device_name(device), sizeof(dev->name));
> - else
> - strscpy(dev->name, acpi_device_bid(device), sizeof(dev->name));
> + strscpy(dev->name, acpi_device_bid(device), sizeof(dev->name));

'dev' here is of struct pnp_dev, so this is the way to fill it.
(I was first confused, but after looking into the full context
everything becomes clear.)

--
With Best Regards,
Andy Shevchenko