Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Rafael J. Wysocki and committed by
Ilpo Järvinen
4f52c972 ba19eb10

+16 -4
+16 -4
drivers/platform/x86/asus-wireless.c
··· 108 108 queue_work(data->wq, &data->led_work); 109 109 } 110 110 111 - static void asus_wireless_notify(struct acpi_device *adev, u32 event) 111 + static void asus_wireless_notify(acpi_handle handle, u32 event, void *context) 112 112 { 113 - struct asus_wireless_data *data = acpi_driver_data(adev); 113 + struct asus_wireless_data *data = context; 114 + struct acpi_device *adev = data->adev; 114 115 115 116 dev_dbg(&adev->dev, "event=%#x\n", event); 116 117 if (event != 0x88) { ··· 167 166 data->led.default_trigger = "rfkill-none"; 168 167 err = devm_led_classdev_register(&adev->dev, &data->led); 169 168 if (err) 170 - destroy_workqueue(data->wq); 169 + goto err; 171 170 171 + err = acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY, 172 + asus_wireless_notify, data); 173 + if (err) { 174 + devm_led_classdev_unregister(&adev->dev, &data->led); 175 + goto err; 176 + } 177 + return 0; 178 + 179 + err: 180 + destroy_workqueue(data->wq); 172 181 return err; 173 182 } 174 183 ··· 186 175 { 187 176 struct asus_wireless_data *data = acpi_driver_data(adev); 188 177 178 + acpi_dev_remove_notify_handler(adev, ACPI_DEVICE_NOTIFY, 179 + asus_wireless_notify); 189 180 if (data->wq) { 190 181 devm_led_classdev_unregister(&adev->dev, &data->led); 191 182 destroy_workqueue(data->wq); ··· 201 188 .ops = { 202 189 .add = asus_wireless_add, 203 190 .remove = asus_wireless_remove, 204 - .notify = asus_wireless_notify, 205 191 }, 206 192 }; 207 193 module_acpi_driver(asus_wireless_driver);