]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: accel: adxl367: Stop using iio_device_claim_direct_scoped()
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 9 Feb 2025 18:06:05 +0000 (18:06 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Feb 2025 12:58:09 +0000 (12:58 +0000)
commit7c00c85a635bd458cfa07e8e59f9b467abc44777
tree87cad4ede492b0725df05b3f98a6f1fd7845b65e
parent7b7f7e6ee01bf93d5121805292ef810e1148727c
iio: accel: adxl367: Stop using iio_device_claim_direct_scoped()

This complex cleanup.h use case of conditional guards has proved
to be more trouble that it is worth in terms of false positive compiler
warnings and hard to read code.

Move directly to the new claim/release_direct() that allow sparse
to check for unbalanced context

In some cases there is a convenient wrapper function to which
the handling can be moved. Do that instead of introducing
another layer of wrappers. In others an outer wrapper is added
which claims direct mode, runs the original function with the
scoped claim logic removed, releases direct mode and then checks
for errors.

Cc: Cosmin Tanislav <demonsingur@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://patch.msgid.link/20250209180624.701140-9-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl367.c