Re: [PATCH 3/8] iio: magnetometer: ak8975: switch to using managed resources
From: Andy Shevchenko
Date: Sat May 09 2026 - 02:52:46 EST
On Fri, May 08, 2026 at 03:51:06PM +0200, Joshua Crofts wrote:
> On Fri, 8 May 2026 at 11:58, Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > On Thu, May 07, 2026 at 04:35:52PM +0200, Joshua Crofts via B4 Relay wrote:
...
> > > + /* Only power down if currently active */
> > > + if (pm_runtime_status_suspended(dev))
> >
> > Is this one a correct one?
> > We also have pm_runtime_suspended(), which is different.
>
> As we only require the status of the device and not the power.disable_depth,
> pm_runtime_status_suspended() seems adequate.
Last time I have checked the code on this I remember that probably this one
doesn't guarantee that immediately after returning to the caller the device is
still in a suspend status.
The difference between two as documentation said is in "...if runtime PM
is enabled for @dev..." for the pm_runtime_suspended(). So the
pm_runtime_suspended() is stricter in that sense.
--
With Best Regards,
Andy Shevchenko