Re: [PATCH v2 17/17] iio: light: us5182d: Discard pm_runtime_put_autosuspend() return values
From: Jonathan Cameron
Date: Sun Oct 25 2026 - 20:54:29 EST
On Wed, 21 Oct 2026 16:57:18 -0700
Brian Norris <briannorris@xxxxxxxxxxxx> wrote:
> This driver propagates the return value of pm_runtime_put_autosuspend(),
> which is not particularly useful.
>
> Returning an error code from pm_runtime_put_autosuspend() merely means
> that it has not queued up a timer or work item to check whether or not
> the device can be suspended and there are many perfectly valid
> situations in which that can happen, like after writing "on" to the
> device's runtime PM "control" attribute in sysfs for one example.
>
> For this reason, modify this driver to simply discard the
> pm_runtime_put_autosuspend() return value.
>
> This will facilitate a planned change of the
> pm_runtime_put_autosuspend() return type to void in the future, similar
> to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return
> type to void").
>
> Signed-off-by: Brian Norris <briannorris@xxxxxxxxxxxx>
> ---
For reference, the power control function in this one is:
static int us5182d_set_power_state(struct us5182d_data *data, bool on)
{
if (data->power_mode == US5182D_ONESHOT)
return 0;
if (on)
return pm_runtime_resume_and_get(&data->client->dev);
return pm_runtime_put_autosuspend(&data->client->dev);
}
So there is that bit of 'special' at the top. Honestly I've not
looked at why that is there, but for now I don't care - the
change proposed here is sensible on it's own plus removes at least
some of the 'special' :)
So applied to the testing branch of iio.git.
Thanks,
Jonathan