Re: [PATCH v1] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
From: Rafael J. Wysocki (Intel)
Date: Mon Jul 06 2026 - 12:37:24 EST
On Mon, Jul 6, 2026 at 5:46 PM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> 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.
Yeah, makes sense. I'll send a v2.