Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: adc: mp2629: fix wrong comparison of channel

Input voltage channel enum is compared against iio address instead
of the channel.

Fixes: 7abd9fb64682 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20221029093000.45451-2-sravanhome@gmail.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Saravanan Sekar and committed by
Jonathan Cameron
1eb20332 741cec30

+1 -1
+1 -1
drivers/iio/adc/mp2629_adc.c
··· 74 74 if (ret) 75 75 return ret; 76 76 77 - if (chan->address == MP2629_INPUT_VOLT) 77 + if (chan->channel == MP2629_INPUT_VOLT) 78 78 rval &= GENMASK(6, 0); 79 79 *val = rval; 80 80 return IIO_VAL_INT;