Patch "ACPI: button: Convert the driver to a platform one" has been added to the 6.18-stable tree
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 7 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
ACPI: button: Convert the driver to a platform one
to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
Quoted 7 lines
The filename of the patch is:
acpi-button-convert-the-driver-to-a-platform-one.patch
and it can be found in the queue-6.18 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Is a driver conversion really "stable" material? I wouldn't think so.
Same for the "Adjust event notification routine" patch.
Please drop those.
Quoted 205 lines
commit
04681d258c4a7119c6f042f3e3ff1eb4ed356615Author: Rafael J. Wysocki <[email protected]> Date: Mon Dec 15 14:57:57 2025 +0100ACPI: button: Convert the driver to a platform one
[ Upstream commit
52d86401963666423cb9a56d117136c846093db0]While binding drivers directly to struct
acpi_deviceobjects allows basic functionality to be provided, at least in the majority of cases, there are some problems with it, related to general consistency, sysfs layout, power management operation ordering, and code cleanliness.Overall, it is better to bind drivers to platform devices than to their ACPI companions, so convert the ACPI button driver to a platform one.
While this is not expected to alter functionality, it changes sysfs layout and so it will be visible to user space.
Signed-off-by Rafael J. Wysocki <[email protected]>Stable-dep-of:
e91f8c5305b9("ACPI: button: Calldevice_init_wakeup()earlier during probe")Signed-off-by Sasha Levin <[email protected]>drivers/acpi/button.c +32
-29@@ -19,6 +19,7 @@#include <linux/slab.h> #include <linux/acpi.h> #include <linux/dmi.h> +#include <linux/platform_device.h> #include <acpi/button.h> #define ACPI_BUTTON_CLASS "button"@@ -145,8 +146,8 @@ static const struct dmi_system_id dmi_lid_quirks[] = { {} }; -static int acpi_button_add (struct acpi_device *device); -static void acpi_button_remove (struct acpi_device *device); +static int acpi_button_probe (struct platform_device *pdev); +static void acpi_button_remove (struct platform_device *pdev);#ifdef CONFIG_PM_SLEEP static int acpi_button_suspend (struct device *dev);@@ -157,19 +158,19 @@ static int acpi_button_resume(struct device *dev);#endif static SIMPLE_DEV_PM_OPS(acpi_button_pm, acpi_button_suspend, acpi_button_resume); -static struct acpi_driver acpi_button_driver = { - .name ="button" , - .class =ACPI_BUTTON_CLASS , - .ids = button_device_ids, - .ops = { - .add = acpi_button_add, - .remove = acpi_button_remove, +static struct platform_driver acpi_button_driver = { + .probe = acpi_button_probe, + .remove = acpi_button_remove, + .driver = { + .name ="acpi-button" , + .acpi_match_table = button_device_ids, + .pm = &acpi_button_pm, }, - .drv.pm = &acpi_button_pm, };struct acpi_button {struct acpi_device *adev; +struct platform_device *pdev;unsigned int type;struct input_dev *input;char phys[32 ];/* for input device */ @@ -397,7 +398,7 @@ static int acpi_lid_update_state(struct acpi_button *button,return state;if (state && signal_wakeup) -acpi_pm_wakeup_event (&device->dev); +acpi_pm_wakeup_event (&button->pdev->dev);return acpi_lid_notify_state (button, state); }@@ -454,7 +455,7 @@ static void acpi_button_notify(acpi_handle handle, u32 event, void *data)return ; } -acpi_pm_wakeup_event (&device->dev); +acpi_pm_wakeup_event (&button->pdev->dev);if (button->suspended || event ==ACPI_BUTTON_NOTIFY_WAKE )return ;@@ -486,8 +487,7 @@ static u32 acpi_button_event(void *data)#ifdef CONFIG_PM_SLEEP static int acpi_button_suspend (struct device *dev) { -struct acpi_device *device =to_acpi_device (dev); -struct acpi_button *button =acpi_driver_data (device); +struct acpi_button *button =dev_get_drvdata (dev); button->suspended = true;return 0 ;@@ -495,9 +495,9 @@ static int acpi_button_suspend(struct device *dev)static int acpi_button_resume (struct device *dev) { +struct acpi_button *button =dev_get_drvdata (dev); +struct acpi_device *device =ACPI_COMPANION (dev);struct input_dev *input; -struct acpi_device *device =to_acpi_device (dev); -struct acpi_button *button =acpi_driver_data (device); button->suspended = false;if (button->type ==ACPI_BUTTON_TYPE_LID ) {@@ -529,8 +529,9 @@ static int acpi_lid_input_open(struct input_dev *input)return 0 ; } -static int acpi_button_add (struct acpi_device *device) +static int acpi_button_probe (struct platform_device *pdev) { +struct acpi_device *device =ACPI_COMPANION (&pdev->dev);acpi_notify_handler handler;struct acpi_button *button;struct input_dev *input;@@ -547,8 +548,9 @@ static int acpi_button_add(struct acpi_device *device)if (!button)return -ENOMEM ; - device->driver_data = button; +platform_set_drvdata (pdev, button); + button->pdev = pdev; button->adev = device; button->input = input =input_allocate_device ();if (!input) {@@ -599,7 +601,7 @@ static int acpi_button_add(struct acpi_device *device) input->phys = button->phys; input->id.bustype =BUS_HOST ; input->id.product = button->type; - input->dev.parent = &device->dev; + input->dev.parent = &pdev->dev;switch (button->type) {case ACPI_BUTTON_TYPE_POWER :@@ -653,7 +655,7 @@ static int acpi_button_add(struct acpi_device *device) lid_device = device; } -device_init_wakeup (&device->dev, true); +device_init_wakeup (&pdev->dev, true);pr_info ("%s [%s]\n" , name,acpi_device_bid (device));return 0 ;@@ -666,9 +668,10 @@ static int acpi_button_add(struct acpi_device *device)return error; } -static void acpi_button_remove (struct acpi_device *device) +static void acpi_button_remove (struct platform_device *pdev) { -struct acpi_button *button =acpi_driver_data (device); +struct acpi_device *device =ACPI_COMPANION (&pdev->dev); +struct acpi_button *button =platform_get_drvdata (pdev);switch (device->device_type) {case ACPI_BUS_TYPE_POWER_BUTTON :@@ -727,7 +730,7 @@ module_param_call(lid_init_state, NULL, 0644);MODULE_PARM_DESC (lid_init_state,"Behavior for reporting LID initial state" ); -static int acpi_button_register_driver (struct acpi_driver *driver) +static int __init acpi_button_init (void ) {const struct dmi_system_id *dmi_id;@@ -743,20 +746,20 @@ static int acpi_button_register_driver(struct acpi_driver *driver)* Modules such as nouveau.ko and i915.ko have a link time dependency * on acpi_lid_open(), and would therefore not be loadable on ACPI * capable kernels booted in non-ACPI mode if the return value of -* acpi_bus_register_driver() is returned from here with ACPI disabled +* platform_driver_register() is returned from here with ACPI disabled * when this driver is built as a module. */ if (acpi_disabled)return 0 ; -return acpi_bus_register_driver (driver); +return platform_driver_register (&acpi_button_driver); } -static void acpi_button_unregister_driver (struct acpi_driver *driver) +static void __exit acpi_button_exit(void) {if (!acpi_disabled) -acpi_bus_unregister_driver (driver); +platform_driver_unregister (&acpi_button_driver); } -module_driver (acpi_button_driver, acpi_button_register_driver, - acpi_button_unregister_driver); +module_init (acpi_button_init); +module_exit (acpi_button_exit);
Sasha Levin
maintainerQuoted 12 lines · Rafael J
Quoted 11 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
ACPI: button: Convert the driver to a platform one
to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
acpi-button-convert-the-driver-to-a-platform-one.patch
and it can be found in the queue-6.18 subdirectory.
Quoted 6 lines
Quoted 3 lines
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Is a driver conversion really "stable" material? I wouldn't think so.
Same for the "Adjust event notification routine" patch.
It's not :) They were brought for:
Quoted 3 lines
Quoted 1 line
Stable-dep-of:
e91f8c5305b9("ACPI: button: Calldevice_init_wakeup()earlier during probe")Please drop those.
I'll drop those two, but I'll also need to drop e91f8c5305b9.
Signature · 2 lines
Thanks, Sasha
Quoted 20 lines · Sasha Levin
Quoted 12 lines · Rafael J
Quoted 11 lines · Sasha Levin
This is a note to let you know that I've just added the patch titled
ACPI: button: Convert the driver to a platform one
to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryThe filename of the patch is:
acpi-button-convert-the-driver-to-a-platform-one.patch and it can be found in the queue-6.18 subdirectory.Quoted 6 lines
Quoted 3 lines
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Is a driver conversion really "stable" material? I wouldn't think so.
Same for the "Adjust event notification routine" patch.
Quoted 8 lines
It's not :) They were brought for:
Quoted 3 lines
Quoted 1 line
Stable-dep-of:
e91f8c5305b9("ACPI: button: Calldevice_init_wakeup()earlier during probe")Please drop those.
I'll drop those two, but I'll also need to drop
e91f8c5305b9.
That's fine.