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

From: Ethan Tidmore

Date: Tue Feb 17 2026 - 04:11:31 EST


On Tue Feb 17, 2026 at 3:03 AM CST, Andy Shevchenko wrote:
> 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?

Ignore my previous statement about sending v4 shortly now. No, I don't
have the HW, but I will be happy to integrate your series into this
cleanup.

Thanks,

ET