mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH v1] ACPI: fan: Use devm_acpi_install_notify_handler()
Date: Wed, 8 Jul 2026 22:03:13 +0200	[thread overview]
Message-ID: <f035da8c-4de6-4985-9401-1dd74a730dff@gmx.de> (raw)
In-Reply-To: <2866967.mvXUDI8C0e@rafael.j.wysocki>

Am 08.07.26 um 20:35 schrieb Rafael J. Wysocki:

> From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
>
> Replace the custom open-coded devres-based management of an ACPI notify
> handler with devm_acpi_install_notify_handler().
>
> No intentional functional impact.

Reviewed-by: Armin Wolf <W_Armin@gmx.de>

> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
>   drivers/acpi/fan_core.c |   25 ++++---------------------
>   1 file changed, 4 insertions(+), 21 deletions(-)
>
> --- a/drivers/acpi/fan_core.c
> +++ b/drivers/acpi/fan_core.c
> @@ -489,26 +489,6 @@ static void acpi_fan_notify_handler(acpi
>   	}
>   }
>   
> -static void acpi_fan_notify_remove(void *data)
> -{
> -	struct acpi_fan *fan = data;
> -
> -	acpi_remove_notify_handler(fan->handle, ACPI_DEVICE_NOTIFY, acpi_fan_notify_handler);
> -}
> -
> -static int devm_acpi_fan_notify_init(struct device *dev)
> -{
> -	struct acpi_fan *fan = dev_get_drvdata(dev);
> -	acpi_status status;
> -
> -	status = acpi_install_notify_handler(fan->handle, ACPI_DEVICE_NOTIFY,
> -					     acpi_fan_notify_handler, dev);
> -	if (ACPI_FAILURE(status))
> -		return -EIO;
> -
> -	return devm_add_action_or_reset(dev, acpi_fan_notify_remove, fan);
> -}
> -
>   static int acpi_fan_probe(struct platform_device *pdev)
>   {
>   	int result = 0;
> @@ -556,7 +536,10 @@ static int acpi_fan_probe(struct platfor
>   		if (result)
>   			return result;
>   
> -		result = devm_acpi_fan_notify_init(&pdev->dev);
> +		result = devm_acpi_install_notify_handler(&pdev->dev,
> +							  ACPI_DEVICE_NOTIFY,
> +							  acpi_fan_notify_handler,
> +							  &pdev->dev);
>   		if (result)
>   			return result;
>   
>
>
>

      reply	other threads:[~2026-07-08 20:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08 18:35 Rafael J. Wysocki
2026-07-08 20:03 ` Armin Wolf [this message]

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=f035da8c-4de6-4985-9401-1dd74a730dff@gmx.de \
    --to=w_armin@gmx.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@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