Re: [PATCH v1] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
From: Andy Shevchenko
Date: Mon Jul 06 2026 - 13:55:08 EST
On Mon, Jul 06, 2026 at 02:28:56PM +0200, Rafael J. Wysocki wrote:
> Since acpi_device_name() set by the driver is only used for input
> class device name initialization and printing a message on probe
> success, and SURFACE_BUTTON_DEVICE_NAME can be used instead of it
> directly in both cases, make the driver do so and stop setting
> acpi_device_name().
>
> No intentional functional impact.
>
> This will facilitate the removal of device_name from struct
> acpi_device_pnp in the future.
...
> - input->name = acpi_device_name(device);
> + input->name = SURFACE_BUTTON_DEVICE_NAME;
> input->phys = button->phys;
> input->id.bustype = BUS_HOST;
> input->dev.parent = &pdev->dev;
> - dev_info(&pdev->dev, "%s [%s]\n", acpi_device_name(device),
> + dev_info(&pdev->dev, SURFACE_BUTTON_DEVICE_NAME " [%s]\n",
> acpi_device_bid(device));
I would keep one place of accessing the definition:
dev_info(&pdev->dev, "%s [%s]\n", input->name, acpi_device_bid(device));
If we ever change that, we won't need to look at two (or more) places.
--
With Best Regards,
Andy Shevchenko