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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Jun 2022 07:03:29 +0000 (09:03 +0200)
commitd361b3cc1cf8abe81a7046cd6e4a583aad867dfe
treeffc3c2aad62437d80417d6cc8ab293b04fc82d25
parent148bab179f04583b271aaf584f333a1678f6cc09
iio: adc: stm32: Fix ADCs iteration in irq handler

commit d2214cca4d3eadc74eac9e30301ec7cad5355f00 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/iio/adc/stm32-adc-core.c