提交 1eb20332 编写于 作者: S Saravanan Sekar 提交者: Jonathan Cameron

iio: adc: mp2629: fix wrong comparison of channel

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

Fixes: 7abd9fb6 ("iio: adc: mp2629: Add support for mp2629 ADC driver")
Signed-off-by: NSaravanan Sekar <sravanhome@gmail.com>
Reviewed-by: NAndy 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: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 741cec30
......@@ -74,7 +74,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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册