* [PATCH v1] PNP: ACPI: Stop using acpi_device_name()
@ 2026-07-06 12:43 Rafael J. Wysocki
2026-07-08 14:39 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Rafael J. Wysocki @ 2026-07-06 12:43 UTC (permalink / raw)
To: Linux ACPI; +Cc: Andy Shevchenko, Bjorn Helgaas, LKML
From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
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.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/pnp/pnpacpi/core.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
index fbf03ff007eb..d8ec0ad2ab4e 100644
--- a/drivers/pnp/pnpacpi/core.c
+++ b/drivers/pnp/pnpacpi/core.c
@@ -248,10 +248,7 @@ static int __init pnpacpi_add_device(struct acpi_device *device)
if (acpi_has_method(device->handle, "_DIS"))
dev->capabilities |= PNP_DISABLE;
- 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));
if (dev->active)
pnpacpi_parse_allocated_resource(dev);
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v1] PNP: ACPI: Stop using acpi_device_name()
2026-07-06 12:43 [PATCH v1] PNP: ACPI: Stop using acpi_device_name() Rafael J. Wysocki
@ 2026-07-08 14:39 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-07-08 14:39 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: Linux ACPI, Bjorn Helgaas, LKML
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@linux.intel.com>
...
> - 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-08 14:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-06 12:43 [PATCH v1] PNP: ACPI: Stop using acpi_device_name() Rafael J. Wysocki
2026-07-08 14:39 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®