提交 5ccc612b 编写于 作者: R Renato Lui Geh 提交者: Jonathan Cameron

staging: iio: ad7780: fix offset read value

Variable val subtracted an uninitialized value on IIO_CHAN_INFO_OFFSET.
This was fixed by assigning the correct value instead.
Signed-off-by: NRenato Lui Geh <renatogeh@gmail.com>
Acked-by: NAlexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
上级 382c7fce
...@@ -96,7 +96,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev, ...@@ -96,7 +96,7 @@ static int ad7780_read_raw(struct iio_dev *indio_dev,
*val2 = chan->scan_type.realbits - 1; *val2 = chan->scan_type.realbits - 1;
return IIO_VAL_FRACTIONAL_LOG2; return IIO_VAL_FRACTIONAL_LOG2;
case IIO_CHAN_INFO_OFFSET: case IIO_CHAN_INFO_OFFSET:
*val -= (1 << (chan->scan_type.realbits - 1)); *val = -(1 << (chan->scan_type.realbits - 1));
return IIO_VAL_INT; return IIO_VAL_INT;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册