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

"Rafael J. Wysocki (Intel)" <[email protected]> Fri, 7 Aug 2026 15:20:43 +0200
Newsgroups gmane.linux.kernel,gmane.linux.acpi.devel
Message-ID <CAJZ5v0ia9eb=5PpmP=7bZs+birJ+R=hDKvCMLgFx4cGY8po=zw@mail.gmail.com>
On Wed, Jul 8, 2026 at 4:49 AM Xueqin Luo <[email protected]> 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 <[email protected]>
> ---
>  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
>