Re: [PATCH v1 23/23] PM: runtime: Change pm_runtime_put() return type to void

From: Brian Norris
Date: Mon Jan 05 2026 - 16:33:35 EST


On Mon, Dec 22, 2025 at 09:36:25PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
>
> The primary role of pm_runtime_put() is to decrement the runtime PM
> usage counter of the given device. It always does that regardless of
> the value returned by it later.
>
> In addition, if the runtime PM usage counter after decrementation turns
> out to be zero, a work item is queued up to check whether or not the
> device can be suspended. This is not guaranteed to succeed though and
> even if it is successful, the device may still not be suspended going
> forward.
>
> There are multiple valid reasons why pm_runtime_put() may not decide to
> queue up the work item mentioned above, including, but not limited to,
> the case when user space has written "on" to the device's runtime PM
> "control" file in sysfs. In all of those cases, pm_runtime_put()
> returns a negative error code (even though the device's runtime PM
> usage counter has been successfully decremented by it) which is very
> confusing. In fact, its return value should only be used for debug
> purposes and care should be taken when doing it even in that case.
>
> Accordingly, to avoid the confusion mentioned above, change the return
> type of pm_runtime_put() to void.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> ---
> include/linux/pm_runtime.h | 16 ++--------------
> 1 file changed, 2 insertions(+), 14 deletions(-)

I'm always happy to see rough edges of the runtime PM API sanded off.
Thanks for doing this!

Reviewed-by: Brian Norris <briannorris@xxxxxxxxxxxx>