summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-05 23:11:22 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-03-09 22:17:57 +0300
commit6e5cbf46c27ae46f13c7ac830e618c6e0b1ed07c (patch)
tree82c55ba8bc436b47df145fbcfbf42922ccf634b1
parent6a0c7d388b6a19899ab0db60325699980706fb11 (diff)
downloadlinux-6e5cbf46c27ae46f13c7ac830e618c6e0b1ed07c.tar.xz
ACPI: PAD: Rearrange notify handler installation and removal
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> Link: https://patch.msgid.link/2011993.taCxCBeP46@rafael.j.wysocki
-rw-r--r--drivers/acpi/acpi_pad.c19
1 files 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[] = {