mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-20 09:31:09 +00:00
iio: adc: mp2629: fix wrong comparison of channel
commit1eb20332a0
upstream. Input voltage channel enum is compared against iio address instead of the channel. Fixes:7abd9fb646
("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
656f670613
commit
bd22c232ea
1 changed files with 1 additions and 1 deletions
|
@ -73,7 +73,7 @@ static int mp2629_read_raw(struct iio_dev *indio_dev,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (chan->address == MP2629_INPUT_VOLT)
|
||||
if (chan->channel == MP2629_INPUT_VOLT)
|
||||
rval &= GENMASK(6, 0);
|
||||
*val = rval;
|
||||
return IIO_VAL_INT;
|
||||
|
|
Loading…
Reference in a new issue