Re: [PATCH v1 1/1] iio: core: Simplify IIO core managed APIs

From: Nuno Sá

Date: Tue Feb 17 2026 - 08:28:45 EST


On Tue, 2026-02-17 at 09:45 +0200, Andy Shevchenko wrote:
> On Mon, Feb 16, 2026 at 02:31:57PM +0000, Nuno Sá wrote:
> > On Mon, 2026-02-16 at 09:14 +0100, Andy Shevchenko wrote:
> > > Use devm_add_action_or_reset() instead of devres_alloc() and
> > > devres_add(), which works the same. This will simplify the
> > > code. There is no functional changes.
>
> > LGTM. Just one minor "complain". Anyways:
>
> My answer below.
>
> > Reviewed-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
>
> Thanks!
>
> ...
>
> > > - if (!buffer)
> > > - return -ENOMEM;
> > > + if (IS_ERR(buffer))
> > > + return PTR_ERR(buffer);
> >
> > Subtle change that could have been mentioned in the commit message.
>
> Actually not really a change. Currently the error code is shadowed to -ENOMEM,

Well before that was explicit. Now it also depends on the internals of __devm_add_action().
That is why I said it was subtle. But yes, no functional change.

- Nuno Sá
>