[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250709164933.47913e22@jic23-huawei>
Date: Wed, 9 Jul 2025 16:49:33 +0100
From: Jonathan Cameron <jic23@...nel.org>
To: Andy Shevchenko <andriy.shevchenko@...el.com>
Cc: Sakari Ailus <sakari.ailus@...ux.intel.com>, David Lechner
<dlechner@...libre.com>, Nuno Sá <nuno.sa@...log.com>, Andy
Shevchenko <andy@...nel.org>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>, Uwe Kleine-König <u.kleine-koenig@...libre.com>,
linux-iio@...r.kernel.org, linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 05/12] iio: dac: Remove redundant
pm_runtime_mark_last_busy() calls
On Wed, 9 Jul 2025 11:48:04 +0300
Andy Shevchenko <andriy.shevchenko@...el.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?
>
Powered by blists - more mailing lists