]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: core: Add cleanup.h support for iio_device_claim_*()
authorKurt Borja <kuurtb@gmail.com>
Tue, 20 Jan 2026 06:20:44 +0000 (01:20 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 22 Jan 2026 20:53:17 +0000 (20:53 +0000)
commit7a38b75da1dc38a8cd9563c41b87367b2475b975
tree8aa1dda63f2a9a71cec6706c8dbef50a925c55f3
parent2daee817df13fb539be01a6a8094d52667d402f6
iio: core: Add cleanup.h support for iio_device_claim_*()

Add guard classes for iio_device_claim_*() conditional locks. This will
aid drivers write safer and cleaner code when dealing with some common
patterns.

These classes are not meant to be used directly by drivers (hence the
__priv__ prefix). Instead, documented wrapper macros are provided to
enforce the use of ACQUIRE() or guard() semantics and avoid the
problematic scoped guard.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
include/linux/iio/iio.h