]> git.ipfire.org Git - thirdparty/linux.git/commit
iio: adc: ingenic-adc: refactor ingenic_adc_read_chan_info_raw()
authorFelipe Ribeiro de Souza <felipers@ime.usp.br>
Wed, 6 May 2026 02:24:29 +0000 (23:24 -0300)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2026 09:59:37 +0000 (10:59 +0100)
commit7ea43bebc7966cc7c5c36bfaa9a3a1a404b32908
treed5239a1496a3b5d867959271b6c145ecb5e89433
parenta3c9f6785954f0919cb9d9ed7ef2fe76972eaa68
iio: adc: ingenic-adc: refactor ingenic_adc_read_chan_info_raw()

Extract the sample logic from ingenic_adc_read_chan_info_raw() into
a new helper function __ingenic_adc_read_chan() to improve code
readability and modularity.

The helper handles the mutex-protected section for sampling channels,
while the main function manages mutex and clock enabling/disabling.

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