[PATCH v2 05/12] iio: dac: Remove redundant pm_runtime_mark_last_busy() calls
Jonathan Cameron
jic23 at kernel.org
Wed Jul 9 08:49:33 PDT 2025
On Wed, 9 Jul 2025 11:48:04 +0300
Andy Shevchenko <andriy.shevchenko at intel.com> wrote:
> On Wed, Jul 09, 2025 at 02:11:52AM +0300, Sakari Ailus wrote:
> > pm_runtime_put_autosuspend(), pm_runtime_put_sync_autosuspend(),
> > pm_runtime_autosuspend() and pm_request_autosuspend() now include a call
> > to pm_runtime_mark_last_busy(). Remove the now-reduntant explicit call to
> > pm_runtime_mark_last_busy().
>
> ...
>
> > - if (!enable) {
> > - pm_runtime_mark_last_busy(dev);
> > + if (!enable)
> > pm_runtime_put_autosuspend(dev);
> > - }
> >
> > return 0;
> >
> > err_put_pm:
> > - if (enable) {
> > - pm_runtime_mark_last_busy(dev);
> > + if (enable)
> > pm_runtime_put_autosuspend(dev);
> > - }
> >
> > return ret;
>
>
> Hmm... Why not simply
>
> ret = 0;
It's already zero (as last call was a regmap_update_bits() return value ) so even easier.
However, switch if (ret < 0) to if (ret) for that regmap call
to make that more obvious.
>
> err_put_pm:
> if (enable)
> pm_runtime_put_autosuspend(dev);
>
> return ret;
>
> instead of the duplication?
>
More information about the linux-arm-kernel
mailing list