diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2026-02-28 16:12:02 +0100 |
|---|---|---|
| committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2026-04-07 12:41:42 +0300 |
| commit | 4f52c97292587c0ad21f3bc78cb2345f7dfc6c89 (patch) | |
| tree | 5bac00feb8ca32258b6bf8fb932c00aac8c1474f | |
| parent | ba19eb10170b50cd613aa18cfb0e1b4693db7edf (diff) | |
platform/x86: asus-wireless: 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>
Reviewed-by: Denis Benato <denis.benato@linux.dev>
Link: https://patch.msgid.link/1949745.tdWV9SEqCh@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/asus-wireless.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/platform/x86/asus-wireless.c b/drivers/platform/x86/asus-wireless.c index 41227bf95878..45d41875c515 100644 --- a/drivers/platform/x86/asus-wireless.c +++ b/drivers/platform/x86/asus-wireless.c @@ -108,9 +108,10 @@ static void led_state_set(struct led_classdev *led, enum led_brightness value) queue_work(data->wq, &data->led_work); } -static void asus_wireless_notify(struct acpi_device *adev, u32 event) +static void asus_wireless_notify(acpi_handle handle, u32 event, void *context) { - struct asus_wireless_data *data = acpi_driver_data(adev); + struct asus_wireless_data *data = context; + struct acpi_device *adev = data->adev; dev_dbg(&adev->dev, "event=%#x\n", event); if (event != 0x88) { @@ -166,8 +167,18 @@ static int asus_wireless_add(struct acpi_device *adev) data->led.default_trigger = "rfkill-none"; err = devm_led_classdev_register(&adev->dev, &data->led); if (err) - destroy_workqueue(data->wq); + goto err; + + err = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY, + asus_wireless_notify, data); + if (err) { + devm_led_classdev_unregister(&adev->dev, &data->led); + goto err; + } + return 0; +err: + destroy_workqueue(data->wq); return err; } @@ -175,6 +186,8 @@ static void asus_wireless_remove(struct acpi_device *adev) { struct asus_wireless_data *data = acpi_driver_data(adev); + acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY, + asus_wireless_notify); if (data->wq) { devm_led_classdev_unregister(&adev->dev, &data->led); destroy_workqueue(data->wq); @@ -188,7 +201,6 @@ static struct acpi_driver asus_wireless_driver = { .ops = { .add = asus_wireless_add, .remove = asus_wireless_remove, - .notify = asus_wireless_notify, }, }; module_acpi_driver(asus_wireless_driver); |
