[PATCH v4 05/15] iio: adc: stm32-adc: rework internal channels data
Andy Shevchenko
andriy.shevchenko at intel.com
Mon Oct 12 14:03:04 PDT 2026
On Tue, Oct 06, 2026 at 09:57:36AM +0200, Fabrice Gasnier wrote:
> Diversity in internal channels data array lead to have zeroed data.
> To facilitate addition of new internal channels, without touching
> all array initializers, only focus on exiting channels on each
> supported ADC variant (e.g. each SoC).
>
> This also allows to get rid of static_assert() checks.
>
> No functional change intended.
> Cosmetic update: remove comma on STM32_ADC_INT_CH_NB as it should
> always be the last element.
...
> static int stm32_adc_populate_int_ch(struct iio_dev *indio_dev, const char *ch_n
> int i, ret;
>
> for (i = 0; i < STM32_ADC_INT_CH_NB; i++) {
> - if (!strncmp(stm32_adc_ic[i].name, ch_name, STM32_ADC_CH_SZ)) {
> + if (!strncmp(stm32_adc_ic[i], ch_name, STM32_ADC_CH_SZ)) {
So, now this can be converted to use match_string() I believe. However, if you
are going to do that, it might be a separate patch. OTOH, this is not fix
anyway, so might be also integrated (but makes a huge change). Up to you.
--
With Best Regards,
Andy Shevchenko
More information about the linux-arm-kernel
mailing list