Re: [PATCH] ACPI: TAD: Use devm_pm_runtime_set_active_enabled()

From: Rafael J. Wysocki (Intel)

Date: Fri Aug 07 2026 - 09:29:33 EST


On Wed, Jul 8, 2026 at 4:49 AM Xueqin Luo <luoxueqin@xxxxxxxxxx> wrote:
>
> Replace pm_runtime_set_active() and pm_runtime_enable() with
> devm_pm_runtime_set_active_enabled(), which also handles runtime PM
> cleanup on driver remove. Drop the redundant pm_runtime_disable() call
> from acpi_tad_remove() accordingly.

The runtime PM on driver removal is handled already AFAICS and the
code before the change is simpler than after it.

So why change it?

> Signed-off-by: Xueqin Luo <luoxueqin@xxxxxxxxxx>
> ---
> drivers/acpi/acpi_tad.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/acpi_tad.c b/drivers/acpi/acpi_tad.c
> index fc43df083738..51f8d1b9a8fb 100644
> --- a/drivers/acpi/acpi_tad.c
> +++ b/drivers/acpi/acpi_tad.c
> @@ -809,7 +809,6 @@ static void acpi_tad_remove(void *data)
> }
>
> pm_runtime_suspend(dev);
> - pm_runtime_disable(dev);
> }
>
> static int acpi_tad_probe(struct platform_device *pdev)
> @@ -866,8 +865,10 @@ static int acpi_tad_probe(struct platform_device *pdev)
> * The platform bus type probe callback tells the ACPI PM domain to
> * power up the device, so set the runtime PM status of it to "active".
> */
> - pm_runtime_set_active(dev);
> - pm_runtime_enable(dev);
> + ret = devm_pm_runtime_set_active_enabled(dev);
> + if (ret)
> + return ret;
> +
> pm_runtime_suspend(dev);
>
> /*
> --
> 2.43.0
>