Skip to content

Commit 6e5cbf4

Browse files
committed
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
1 parent 6a0c7d3 commit 6e5cbf4

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

drivers/acpi/acpi_pad.c

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -407,8 +407,7 @@ static void acpi_pad_handle_notify(acpi_handle handle)
407407
mutex_unlock(&isolated_cpus_lock);
408408
}
409409

410-
static void acpi_pad_notify(acpi_handle handle, u32 event,
411-
void *data)
410+
static void acpi_pad_notify(acpi_handle handle, u32 event, void *data)
412411
{
413412
struct acpi_device *adev = data;
414413

@@ -427,30 +426,22 @@ static void acpi_pad_notify(acpi_handle handle, u32 event,
427426
static int acpi_pad_probe(struct platform_device *pdev)
428427
{
429428
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
430-
acpi_status status;
431429

432430
strscpy(acpi_device_name(adev), ACPI_PROCESSOR_AGGREGATOR_DEVICE_NAME);
433431
strscpy(acpi_device_class(adev), ACPI_PROCESSOR_AGGREGATOR_CLASS);
434432

435-
status = acpi_install_notify_handler(adev->handle,
436-
ACPI_DEVICE_NOTIFY, acpi_pad_notify, adev);
437-
438-
if (ACPI_FAILURE(status))
439-
return -ENODEV;
440-
441-
return 0;
433+
return acpi_dev_install_notify_handler(adev, ACPI_DEVICE_NOTIFY,
434+
acpi_pad_notify, adev);
442435
}
443436

444437
static void acpi_pad_remove(struct platform_device *pdev)
445438
{
446-
struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
447-
448439
mutex_lock(&isolated_cpus_lock);
449440
acpi_pad_idle_cpus(0);
450441
mutex_unlock(&isolated_cpus_lock);
451442

452-
acpi_remove_notify_handler(adev->handle,
453-
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
443+
acpi_dev_remove_notify_handler(ACPI_COMPANION(&pdev->dev),
444+
ACPI_DEVICE_NOTIFY, acpi_pad_notify);
454445
}
455446

456447
static const struct acpi_device_id pad_device_ids[] = {

0 commit comments

Comments
 (0)