]> Gentwo Git Trees - linux/.git/commit
iio: accel: kx022a: Use cleanup.h helpers
authorMatti Vaittinen <mazziesaccount@gmail.com>
Thu, 28 Nov 2024 09:01:48 +0000 (11:01 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 7 Dec 2024 17:49:11 +0000 (17:49 +0000)
commit725521e1f485d4687790f2e459271f1ad6af64d5
tree2066043744461c70d8af8ccebbb699f5449f6eb0
parent0c39208bc3af6f7afcbcdb675ad8fbe6b3022865
iio: accel: kx022a: Use cleanup.h helpers

A few functions in KX022A need to use mutex for protecting the
enabling/disabling of the measurement while configurations are being
made. Some of the functions can be slightly simplified by using the
__cleanup based scoped mutexes, which allows dropping the goto based
unlocking at error path.

Simplify error paths using guard(mutex).

Signed-off-by: Matti Vaittinen <mazziesaccount@gmail.com>
Link: https://patch.msgid.link/4785f841ad5f131356ba78b4f3c76f676d86a2e8.1732783834.git.mazziesaccount@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/accel/kionix-kx022a.c