Re: [PATCH RFC 0/6] iio: core: Introduce cleanup.h support for mode locks
From: Andy Shevchenko
Date: Thu Dec 04 2025 - 10:08:07 EST
On Thu, Dec 4, 2025 at 4:35 PM Nuno Sá <noname.nuno@xxxxxxxxx> wrote:
> On Wed, 2025-12-03 at 14:18 -0500, Kurt Borja wrote:
> >
> > In a recent driver review discussion [1], Andy Shevchenko suggested we
> > add cleanup.h support for the lock API:
> >
> > iio_device_claim_{direct,buffer_mode}().
>
> We already went this patch and then reverted it. I guess before we did not had
> ACQUIRE() and ACQUIRE_ERR() but I'm not sure that makes it much better. Looking at the
> last two patches on how we are handling the buffer mode stuff, I'm really not convinced...
>
> Also, I have doubts sparse can keep up with the __cleanup stuff so I'm not sure the
> annotations much make sense if we go down this path. Unless we want to use both
> approaches which is also questionable.
This, indeed, needs a (broader) discussion and I appreciate that Kurt
sent this RFC. Jonathan, what's your thoughts?
--
With Best Regards,
Andy Shevchenko