* [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
@ 2026-07-07 11:12 Rafael J. Wysocki
2026-07-08 14:26 ` Andy Shevchenko
2026-07-09 13:39 ` Ilpo Järvinen
0 siblings, 2 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2026-07-07 11:12 UTC (permalink / raw)
To: Ilpo Järvinen, platform-driver-x86
Cc: Andy Shevchenko, Hans de Goede, Linux ACPI, LKML, Chen Yu,
Maximilian Luz
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Subject: [PATCH v1] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
The driver sets acpi_device_name() to initialize an input class device
name initialization and print a message on probe success, but the input
class device name can be set directly to the "Surface Pro 3/4 Buttons"
string literal and used for printing the message.
Make the driver do so, stop setting acpi_device_name() in it and drop
the symbol specifically defined for this purpose.
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>
Reviewed-by: Chen Yu <yu.c.chen@intel.com>
---
v1 -> v2:
* Use input->name for printing the final message in
surface_button_probe() (Andy)
* Add R-by from Yu
---
drivers/platform/surface/surfacepro3_button.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
--- a/drivers/platform/surface/surfacepro3_button.c
+++ b/drivers/platform/surface/surfacepro3_button.c
@@ -20,7 +20,6 @@
#define SURFACE_PRO3_BUTTON_HID "MSHW0028"
#define SURFACE_PRO4_BUTTON_HID "MSHW0040"
#define SURFACE_BUTTON_OBJ_NAME "VGBI"
-#define SURFACE_BUTTON_DEVICE_NAME "Surface Pro 3/4 Buttons"
#define MSHW0040_DSM_REVISION 0x01
#define MSHW0040_DSM_GET_OMPR 0x02 // get OEM Platform Revision
@@ -212,11 +211,10 @@ static int surface_button_probe(struct p
goto err_free_button;
}
- strscpy(acpi_device_name(device), SURFACE_BUTTON_DEVICE_NAME);
snprintf(button->phys, sizeof(button->phys), "%s/buttons",
acpi_device_hid(device));
- input->name = acpi_device_name(device);
+ input->name = "Surface Pro 3/4 Buttons";
input->phys = button->phys;
input->id.bustype = BUS_HOST;
input->dev.parent = &pdev->dev;
@@ -239,8 +237,8 @@ static int surface_button_probe(struct p
goto err_free_button;
}
- dev_info(&pdev->dev, "%s [%s]\n", acpi_device_name(device),
- acpi_device_bid(device));
+ dev_info(&pdev->dev, "%s [%s]\n", input->name, acpi_device_bid(device));
+
return 0;
err_free_input:
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
2026-07-07 11:12 [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name() Rafael J. Wysocki
@ 2026-07-08 14:26 ` Andy Shevchenko
2026-07-09 13:39 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-07-08 14:26 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Ilpo Järvinen, platform-driver-x86, Hans de Goede,
Linux ACPI, LKML, Chen Yu, Maximilian Luz
On Tue, Jul 07, 2026 at 01:12:35PM +0200, Rafael J. Wysocki wrote:
> The driver sets acpi_device_name() to initialize an input class device
> name initialization and print a message on probe success, but the input
> class device name can be set directly to the "Surface Pro 3/4 Buttons"
> string literal and used for printing the message.
>
> Make the driver do so, stop setting acpi_device_name() in it and drop
> the symbol specifically defined for this purpose.
>
> 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>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
2026-07-07 11:12 [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name() Rafael J. Wysocki
2026-07-08 14:26 ` Andy Shevchenko
@ 2026-07-09 13:39 ` Ilpo Järvinen
1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2026-07-09 13:39 UTC (permalink / raw)
To: platform-driver-x86, Rafael J. Wysocki
Cc: Andy Shevchenko, Hans de Goede, Linux ACPI, LKML, Chen Yu,
Maximilian Luz
On Tue, 07 Jul 2026 13:12:35 +0200, Rafael J. Wysocki wrote:
> The driver sets acpi_device_name() to initialize an input class device
> name initialization and print a message on probe success, but the input
> class device name can be set directly to the "Surface Pro 3/4 Buttons"
> string literal and used for printing the message.
>
> Make the driver do so, stop setting acpi_device_name() in it and drop
> the symbol specifically defined for this purpose.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.
The list of commits applied:
[1/1] platform/surface: surfacepro3_button: Stop setting acpi_device_name()
commit: a5ea48e114b830bae1229ba7303a0782b8cf9a53
--
i.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-09 13:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-07 11:12 [PATCH v2] platform/surface: surfacepro3_button: Stop setting acpi_device_name() Rafael J. Wysocki
2026-07-08 14:26 ` Andy Shevchenko
2026-07-09 13:39 ` Ilpo Järvinen
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®