]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iio: adc: ingenic-adc: use guard()() and scoped_guard() to handle synchronisation
authorFelipe Ribeiro de Souza <felipers@ime.usp.br>
Wed, 6 May 2026 02:24:30 +0000 (23:24 -0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:37 +0000 (10:59 +0100)
commita42fea859692c424fce81b830fbd4ff258d390a6
tree1078a48b6b062e789a0e74c0cd784dbf83313956
parent7ea43bebc7966cc7c5c36bfaa9a3a1a404b32908
iio: adc: ingenic-adc: use guard()() and scoped_guard() to handle synchronisation

Replace mutex_lock() and mutex_unlock() calls with guard()() in
functions ingenic_adc_set_adcmd(), ingenic_adc_set_config(),
ingenic_adc_enable(), ingenic_adc_capture(), and with scoped_guard()
in function ingenic_adc_read_chan_info_raw().

This removes the need to call the unlock function, as the lock is
automatically released when the function return or the scope exits
for any other case.

Signed-off-by: Felipe Ribeiro de Souza <felipers@ime.usp.br>
Co-developed-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com>
Signed-off-by: Lucas Ivars Cadima Ciziks <lucas@ciziks.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/ingenic-adc.c