Re: [PATCH v3 1/2] iio: light: gp2ap020a00f: simplify locking with guard()

From: Andy Shevchenko

Date: Tue Feb 17 2026 - 04:03:57 EST


On Tue, Feb 17, 2026 at 10:37:18AM +0200, Andy Shevchenko wrote:
> On Mon, Feb 16, 2026 at 03:04:55PM -0600, Ethan Tidmore wrote:
> > On Mon Feb 16, 2026 at 1:08 AM CST, Andy Shevchenko wrote:
> > > On Sun, Feb 15, 2026 at 06:53:16PM -0600, Ethan Tidmore wrote:

...

> > >> int i, err = 0;
> > >
> > > Would you need the err assignment now?
> >
> > I'm not familiar with iio_for_each_active_channel() but, if there's a
> > chance it could run zero times, then it'd run into if (err) with err
> > not being initialized?
>
> Have you read my other comments? I also mentioned to replace
>
> err = -ENOMEM;
>
> with
>
> return -ENOMEM;

Looking into the driver code, it has some serious questions about the logic
behind. I will send soon a WIP series for you to take into account. Feel
free to integrate it into your next series.

...

Do you have HW to test?

--
With Best Regards,
Andy Shevchenko