summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-05-21 17:04:03 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2026-05-25 17:43:51 +0300
commit3159c5fcdd3a5eae70b45cbdf453d408266f547d (patch)
treeb275ff0f3d183979485ab5c96504256040174eea
parent97e6c73c6b79396c93dc117f9dbe37a6869e1b7f (diff)
downloadlinux-3159c5fcdd3a5eae70b45cbdf453d408266f547d.tar.xz
ACPI: HED: Switch over to devres-based resource management
Use the newly introduced devm_acpi_install_notify_handler() for installing an ACPI notify handler and since that function checks the ACPI companion of the owner device against NULL internally, remove the the explicit ACPI companion check from acpi_hed_probe(). No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/7950702.EvYhyI6sBW@rafael.j.wysocki
-rw-r--r--drivers/acpi/hed.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/acpi/hed.c b/drivers/acpi/hed.c
index 4b5dc95922ea..48562f53d3ab 100644
--- a/drivers/acpi/hed.c
+++ b/drivers/acpi/hed.c
@@ -50,19 +50,14 @@ static void acpi_hed_notify(acpi_handle handle, u32 event, void *data)
static int acpi_hed_probe(struct platform_device *pdev)
{
- struct acpi_device *device;
int err;
- device = ACPI_COMPANION(&pdev->dev);
- if (!device)
- return -ENODEV;
-
/* Only one hardware error device */
if (hed_present)
return -EINVAL;
- err = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
- acpi_hed_notify, device);
+ err = devm_acpi_install_notify_handler(&pdev->dev, ACPI_DEVICE_NOTIFY,
+ acpi_hed_notify, NULL);
if (err)
return err;
@@ -72,11 +67,7 @@ static int acpi_hed_probe(struct platform_device *pdev)
static void acpi_hed_remove(struct platform_device *pdev)
{
- struct acpi_device *device = ACPI_COMPANION(&pdev->dev);
-
hed_present = false;
- acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
- acpi_hed_notify);
}
static struct platform_driver acpi_hed_driver = {