ACPI: fan: Use devm_acpi_install_notify_handler()
Rafael J. Wysocki
maintainerPATCH 1/1 ACPI: fan: Use devm_acpi_install_notify_handler()
From: "Rafael J. Wysocki" <[email protected]>
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 <[email protected]>
--- drivers/acpi/fan_core.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-)
drivers/acpi/fan_core.c +4 -21
@@ -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 platforif (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;
Am 08.07.26 um 20:35 schrieb Rafael J. Wysocki:
Quoted 6 lines
From: "Rafael J. Wysocki" <[email protected]>
Replace the custom open-coded devres-based management of an ACPI notify handler with
devm_acpi_install_notify_handler().No intentional functional impact.
Reviewed-by Armin Wolf <[email protected]>
Quoted 49 lines
Signed-off-by Rafael J. Wysocki <[email protected]>--- drivers/acpi/fan_core.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-)drivers/acpi/fan_core.c +4
-21@@ -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 platforif (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;