All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux ACPI <linux-acpi@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Hans de Goede <hansg@kernel.org>
Subject: [PATCH v1 2/9] ACPI: PAD: Rearrange notify handler installation and removal
Date: Thu, 05 Mar 2026 21:11:22 +0100	[thread overview]
Message-ID: <2011993.taCxCBeP46@rafael.j.wysocki> (raw)
In-Reply-To: <4505861.ejJDZkT8p0@rafael.j.wysocki>

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

Use acpi_dev_install_notify_handler() and acpi_dev_remove_notify_handler()
for installing and removing the ACPI notify handler, respectively, which
allows acpi_pad_notify() and acpi_pad_remove() to be simplified quite a
bit.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/acpi/acpi_pad.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index c9a0bcaba2e4..407a0d68525c 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -407,8 +407,7 @@ static void acpi_pad_handle_notify(acpi_handle handle)
 	mutex_unlock(&isolated_cpus_lock);
 }
 
-static void acpi_pad_notify(acpi_handle handle, u32 event,
-	void *data)
+static void acpi_pad_notify(acpi_handle handle, u32 event, void *data)
 {
 	struct acpi_device *adev = data;
 
@@ -427,30 +426,22 @@ static void acpi_pad_notify(acpi_handle handle, u32 event,
 static int acpi_pad_probe(struct platform_device *pdev)
 {
 	struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
-	acpi_status status;
 
 	strscpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
 	strscpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS);
 
-	status = acpi_install_notify_handler(adev->handle,
-		ACPI_DEVICE_NOTIFY, acpi_pad_notify, adev);
-
-	if (ACPI_FAILURE(status))
-		return -ENODEV;
-
-	return 0;
+	return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
+					       acpi_pad_notify, adev);
 }
 
 static void acpi_pad_remove(struct platform_device *pdev)
 {
-	struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
-
 	mutex_lock(&isolated_cpus_lock);
 	acpi_pad_idle_cpus(0);
 	mutex_unlock(&isolated_cpus_lock);
 
-	acpi_remove_notify_handler(adev->handle,
-		ACPI_DEVICE_NOTIFY, acpi_pad_notify);
+	acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev),
+				       ACPI_DEVICE_NOTIFY, acpi_pad_notify);
 }
 
 static const struct acpi_device_id pad_device_ids[] = {
-- 
2.51.0





  parent reply	other threads:[~2026-03-05 20:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-05 20:09 [PATCH v1 0/9] ACPI: driver: Cleanups and fixes, mostly related to acpi_device_name/class() Rafael J. Wysocki
2026-03-05 20:10 ` [PATCH v1 1/9] ACPI: AC: Get rid of unnecessary declarations Rafael J. Wysocki
2026-03-05 20:11 ` Rafael J. Wysocki [this message]
2026-03-05 20:12 ` [PATCH v1 3/9] ACPI: video: Consolidate pnp.bus_id workarounds handling Rafael J. Wysocki
2026-03-05 20:16 ` [PATCH v1 4/9] ACPI: video: Rework checking for duplicate video bus devices Rafael J. Wysocki
2026-03-05 20:17 ` [PATCH v1 5/9] ACPI: driver: Do not set acpi_device_name() unnecessarily Rafael J. Wysocki
2026-03-05 20:18 ` [PATCH v1 6/9] ACPI: event: Redefine acpi_notifier_call_chain() Rafael J. Wysocki
2026-03-05 20:20 ` [PATCH v1 7/9] ACPI: driver: Avoid using pnp.device_class for netlink handling Rafael J. Wysocki
2026-03-05 20:21 ` [PATCH v1 8/9] ACPI: driver: Do not set acpi_device_class() unnecessarily Rafael J. Wysocki
2026-03-05 20:27 ` [PATCH v1 9/9] ACPI: AC: Define ACPI_AC_CLASS in one place Rafael J. Wysocki
2026-03-06 12:44   ` Ilpo Järvinen
2026-03-06 12:49     ` Rafael J. Wysocki

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=2011993.taCxCBeP46@rafael.j.wysocki \
    --to=rafael@kernel.org \
    --cc=hansg@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.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.