]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: core: Match iio_device_claim_*() semantics and implementation
authorKurt Borja <kuurtb@gmail.com>
Tue, 20 Jan 2026 06:20:43 +0000 (01:20 -0500)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Thu, 22 Jan 2026 20:53:17 +0000 (20:53 +0000)
commit2daee817df13fb539be01a6a8094d52667d402f6
tree22ee4dd50726710bfa3514aa05a7c66f76f096eb
parentc37ec9d507966a827913f42e06179e3475a00181
iio: core: Match iio_device_claim_*() semantics and implementation

Implement iio_device_claim_buffer_mode() fully inline with the use of
__iio_dev_mode_lock(), which takes care of sparse annotations.

To completely match iio_device_claim_direct() semantics, we need to
also change iio_device_claim_buffer_mode() return semantics to usual
true/false conditional lock semantics.

Additionally, to avoid silently breaking out-of-tree drivers, rename
iio_device_claim_buffer_mode() to iio_device_claim_try_buffer_mode().

Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/ade9000.c
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
drivers/iio/health/max30100.c
drivers/iio/health/max30102.c
drivers/iio/industrialio-core.c
drivers/iio/light/opt4060.c
include/linux/iio/iio.h