Re: [PATCH v4 1/3] iio: adc: Fix incorrect reading when datarate changed in single mode

From: Andy Shevchenko

Date: Tue Jun 23 2026 - 05:40:26 EST


On Tue, Jun 23, 2026 at 11:29:53AM +0200, Joshua Crofts wrote:
> On Tue, 23 Jun 2026 12:16:39 +0300
> Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> wrote:

...

> > > + return read_poll_timeout(ads1100_new_data_not_ready, data_ready,
> > > + !data_ready, wait_time,
>
> I'd actually be all for using `data_ready != 0`, to make the condition more
> readable.

I am okay with either. It might be slightly clearer if the comparison is done
for some dynamic counting or so, when 0 is not special.

...

> > > + PM_RUNTIME_ACQUIRE_AUTOSUSPEND(&data->client->dev, pm);
> >
> > > +
> >
> > This blank line is not needed as they are coupled, but I don't know if we have
> > an agreed style in IIO for this.
>
> I'd be surprised if there was an agreed style, as there aren't any IIO drivers
> that use this specific macro (not in mainline at least). Additionally, might I
> suggest using `PM_RUNTIME_ACQUIRE_IF_ENABLED_AUTOSUSPEND` as it is more generic?

We have other PM_ACQUIRE_*() macros in the drivers in IIO, so we have some style,
but I haven't checked what is that.

--
With Best Regards,
Andy Shevchenko