iio: adc: stm32: Fix ADCs iteration in irq handler
authorYannick Brosseau <yannick.brosseau@gmail.com>
Mon, 16 May 2022 20:39:38 +0000 (16:39 -0400)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 19 Jun 2022 16:22:48 +0000 (17:22 +0100)
commitd2214cca4d3eadc74eac9e30301ec7cad5355f00
tree0e52b2d48111cb9dd016628468c0d21646679b18
parent47dcf770abc793f347a65a24c24d550c936f08b0
iio: adc: stm32: Fix ADCs iteration in irq handler

The irq handler was only checking the mask for the first ADCs in the case of the
F4 and H7 generation, since it was iterating up to the num_irq value. This patch add
the maximum number of ADC in the common register, which map to the number of entries of
eoc_msk and ovr_msk in stm32_adc_common_regs. This allow the handler to check all ADCs in
that module.

Tested on a STM32F429NIH6.

Fixes: 695e2f5c289b ("iio: adc: stm32-adc: fix a regression when using dma and irq")
Signed-off-by: Yannick Brosseau <yannick.brosseau@gmail.com>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20220516203939.3498673-2-yannick.brosseau@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/adc/stm32-adc-core.c