summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-12 17:38:37 +0300
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-03-17 20:51:48 +0300
commitcfc897f6d3f7e9e284d498cd9fc4c68488166f48 (patch)
tree406178621e2743c21fe47607ef558081ae4bab21
parent3471415c8186f952b805c441d905d7033c23304a (diff)
downloadlinux-cfc897f6d3f7e9e284d498cd9fc4c68488166f48.tar.xz
platform/x86: wireless-hotkey: Register ACPI notify handler directly
To facilitate subsequent conversion of the driver to a platform one, make it install an ACPI notify handler directly instead of using a .notify() callback in struct acpi_driver. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/3953848.kQq0lBPeGt@rafael.j.wysocki Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/wireless-hotkey.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/platform/x86/wireless-hotkey.c b/drivers/platform/x86/wireless-hotkey.c
index e5083c0e1515..a0ae757a277e 100644
--- a/drivers/platform/x86/wireless-hotkey.c
+++ b/drivers/platform/x86/wireless-hotkey.c
@@ -71,9 +71,9 @@ static void wireless_input_destroy(struct acpi_device *device)
kfree(button);
}
-static void wl_notify(struct acpi_device *acpi_dev, u32 event)
+static void wl_notify(acpi_handle handle, u32 event, void *data)
{
- struct wl_button *button = acpi_driver_data(acpi_dev);
+ struct wl_button *button = data;
if (event != 0x80) {
pr_info("Received unknown event (0x%x)\n", event);
@@ -101,6 +101,13 @@ static int wl_add(struct acpi_device *device)
if (err) {
pr_err("Failed to setup wireless hotkeys\n");
kfree(button);
+ return err;
+ }
+ err = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
+ wl_notify, button);
+ if (err) {
+ pr_err("Failed to install ACPI notify handler\n");
+ wireless_input_destroy(device);
}
return err;
@@ -108,6 +115,7 @@ static int wl_add(struct acpi_device *device)
static void wl_remove(struct acpi_device *device)
{
+ acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY, wl_notify);
wireless_input_destroy(device);
}
@@ -117,7 +125,6 @@ static struct acpi_driver wl_driver = {
.ops = {
.add = wl_add,
.remove = wl_remove,
- .notify = wl_notify,
},
};