All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Benato <denis.benato@linux.dev>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "Hans de Goede" <hansg@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Linux ACPI" <linux-acpi@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,
	"Corentin Chary" <corentin.chary@gmail.com>,
	"Luke D. Jones" <luke@ljones.dev>,
	"João Paulo Rechi Vita" <jprvita@gmail.com>
Subject: Re: [PATCH v1 3/4] platform/x86: asus-wireless: Register ACPI notify handler directly
Date: Sat, 28 Feb 2026 18:02:13 +0100	[thread overview]
Message-ID: <6da00c19-423f-4735-8cb4-b80c94cfd208@linux.dev> (raw)
In-Reply-To: <1949745.tdWV9SEqCh@rafael.j.wysocki>


On 2/28/26 16:12, Rafael J. Wysocki wrote:
> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>
> 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@linux.dev>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>  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);

  reply	other threads:[~2026-02-28 17:02 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 15:09 [PATCH v1 0/4] platform/x86: asus: Bind drivers to platform devices instead of ACPI ones Rafael J. Wysocki
2026-02-28 15:10 ` [PATCH v1 1/4] platform/x86: asus-laptop: Register ACPI notify handler directly Rafael J. Wysocki
2026-02-28 16:59   ` Denis Benato
2026-02-28 15:11 ` [PATCH v1 2/4] platform/x86: asus-laptop: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-02-28 17:01   ` Denis Benato
2026-03-01 13:08     ` Rafael J. Wysocki
2026-03-02 11:21     ` Ilpo Järvinen
2026-03-31  8:14     ` Ilpo Järvinen
2026-03-31 19:19       ` Denis Benato
2026-02-28 15:12 ` [PATCH v1 3/4] platform/x86: asus-wireless: Register ACPI notify handler directly Rafael J. Wysocki
2026-02-28 17:02   ` Denis Benato [this message]
2026-02-28 15:12 ` [PATCH v1 4/4] platform/x86: asus-wireless: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-02-28 17:02   ` Denis Benato
2026-04-07  9:49   ` Ilpo Järvinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6da00c19-423f-4735-8cb4-b80c94cfd208@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=corentin.chary@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jprvita@gmail.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.