Re: [PATCH v1 3/4] platform/x86: asus-wireless: Register ACPI notify handler directly
From: Denis Benato
Date: Sat Feb 28 2026 - 12:02:43 EST
On 2/28/26 16:12, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@xxxxxxxxx>
>
> 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.
Reviewed-by: Denis Benato <denis.benato@xxxxxxxxx>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> drivers/platform/x86/asus-wireless.c | 20 ++++++++++++++++----
> 1 file 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);