Re: [PATCH RFC 3/6] iio: core: Add cleanup.h support for iio_device_claim_*()

From: Kurt Borja

Date: Sun Dec 07 2025 - 10:59:53 EST


On Sat Dec 6, 2025 at 1:20 PM -05, Jonathan Cameron wrote:
> On Wed, 03 Dec 2025 14:18:17 -0500
> Kurt Borja <kuurtb@xxxxxxxxx> wrote:
>
>> Add guard() and ACQUIRE() support for iio_device_claim_*() lock.
>>
>> This involves exporting iio_device_{claim, release}() wrappers to define
>> a general GUARD class, and then defining the _direct and _buffer
>> conditional ones.
>>
>> Suggested-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxx>
>> Signed-off-by: Kurt Borja <kuurtb@xxxxxxxxx>
>
> I'd like some documentation (alongside the DEFINE_GUARD() stuff)
> - particularly warn people that using the non conditional variant
> is very much the unusual one.
>
> Perhaps add examples of usage for the other two and ignore that one
> on basis alarm bells will ring whenever we see it in code.

Sure! I'll add it.

>
> Jonathan

--
~ Kurt