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

From: Andy Shevchenko

Date: Tue Feb 17 2026 - 02:45:54 EST


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,
but again currently the callee can't return anything else. So, it's just a use
of the regular pattern. TL;DR: there is no functional change currently. If
anything in the future comes returning different error codes here, that will
bring the difference.

Anyways, if Jonathan asks to elaborate and send a new version, I will do for
sure.

--
With Best Regards,
Andy Shevchenko