From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux PM <linux-pm@vger.kernel.org>, Armin Wolf <w_armin@gmx.de>
Subject: [PATCH v1] ACPI: fan: Use devm_acpi_install_notify_handler()
Date: Wed, 08 Jul 2026 20:35:47 +0200 [thread overview]
Message-ID: <2866967.mvXUDI8C0e@rafael.j.wysocki> (raw)
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.
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;
next reply other threads:[~2026-07-08 18:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 18:35 Rafael J. Wysocki [this message]
2026-07-08 20:03 ` [PATCH v1] ACPI: fan: Use devm_acpi_install_notify_handler() Armin Wolf
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=2866967.mvXUDI8C0e@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=w_armin@gmx.de \
/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