public inbox for linux-acpi@vger.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>
Subject: Re: [PATCH v1 1/2] platform/x86: eeepc-laptop: Register ACPI notify handler directly
Date: Sat, 28 Feb 2026 18:03:22 +0100	[thread overview]
Message-ID: <49543dcc-fba8-4b38-a5ae-6016d6bd1dc6@linux.dev> (raw)
In-Reply-To: <3681264.iIbC2pHGDl@rafael.j.wysocki>


On 2/28/26 16:22, 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/eeepc-laptop.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
> index 974f55e0b36f..626a99a71fce 100644
> --- a/drivers/platform/x86/eeepc-laptop.c
> +++ b/drivers/platform/x86/eeepc-laptop.c
> @@ -1204,9 +1204,10 @@ static void eeepc_input_notify(struct eeepc_laptop *eeepc, int event)
>  		pr_info("Unknown key %x pressed\n", event);
>  }
>  
> -static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
> +static void eeepc_acpi_notify(acpi_handle handle, u32 event, void *data)
>  {
> -	struct eeepc_laptop *eeepc = acpi_driver_data(device);
> +	struct eeepc_laptop *eeepc = data;
> +	struct acpi_device *device = eeepc->device;
>  	int old_brightness, new_brightness;
>  	u16 count;
>  
> @@ -1422,9 +1423,16 @@ static int eeepc_acpi_add(struct acpi_device *device)
>  	if (result)
>  		goto fail_rfkill;
>  
> +	result = acpi_dev_install_notify_handler(device, ACPI_ALL_NOTIFY,
> +						 eeepc_acpi_notify, eeepc);
> +	if (result)
> +		goto fail_acpi_notifier;
> +
>  	eeepc_device_present = true;
>  	return 0;
>  
> +fail_acpi_notifier:
> +	eeepc_rfkill_exit(eeepc);
>  fail_rfkill:
>  	eeepc_led_exit(eeepc);
>  fail_led:
> @@ -1444,6 +1452,7 @@ static void eeepc_acpi_remove(struct acpi_device *device)
>  {
>  	struct eeepc_laptop *eeepc = acpi_driver_data(device);
>  
> +	acpi_dev_remove_notify_handler(device, ACPI_ALL_NOTIFY, eeepc_acpi_notify);
>  	eeepc_backlight_exit(eeepc);
>  	eeepc_rfkill_exit(eeepc);
>  	eeepc_input_exit(eeepc);
> @@ -1464,11 +1473,9 @@ static struct acpi_driver eeepc_acpi_driver = {
>  	.name = EEEPC_LAPTOP_NAME,
>  	.class = EEEPC_ACPI_CLASS,
>  	.ids = eeepc_device_ids,
> -	.flags = ACPI_DRIVER_ALL_NOTIFY_EVENTS,
>  	.ops = {
>  		.add = eeepc_acpi_add,
>  		.remove = eeepc_acpi_remove,
> -		.notify = eeepc_acpi_notify,
>  	},
>  };
>  

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 15:21 [PATCH v1 0/2] platform/x86: eeepc-laptop: Bind to a platform device instead of an ACPI one Rafael J. Wysocki
2026-02-28 15:22 ` [PATCH v1 1/2] platform/x86: eeepc-laptop: Register ACPI notify handler directly Rafael J. Wysocki
2026-02-28 17:03   ` Denis Benato [this message]
2026-02-28 15:22 ` [PATCH v1 2/2] platform/x86: eeepc-laptop: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-02-28 17:04   ` Denis Benato
2026-03-09 14:58 ` [PATCH v1 0/2] platform/x86: eeepc-laptop: Bind to a platform device instead of an ACPI one 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=49543dcc-fba8-4b38-a5ae-6016d6bd1dc6@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=corentin.chary@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox