iio: accel: adxl367: Use automated cleanup for locks and iio direct mode.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 28 Jan 2024 15:05:30 +0000 (15:05 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 17 Feb 2024 16:16:10 +0000 (16:16 +0000)
commiteabc6b08476f18de5e0d7fc02aa92f4896f2fc63
tree39a6e352c948b6476d5df06705bedb65f5ac5ad3
parent366328e5ac47a763d77b9dd85172d3eb3735568e
iio: accel: adxl367: Use automated cleanup for locks and iio direct mode.

Switching to the iio_device_claim_direct_scoped() for state
and to guard() based unlocking of mutexes simplifies error handling
by allowing direct returns when an error is encountered.

Reviewed-by: Nuno Sa <nuno.a@analog.com>
Link: https://lore.kernel.org/r/20240128150537.44592-4-jic23@kernel.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/adxl367.c