提交 135f0646 编写于 作者: L Lars-Peter Clausen 提交者: Jonathan Cameron

iio:ad7923: Return error if we didn't get the expected result

Instead of leaving 'val' uninitialized return an error if the result's address
did not match that of the channel we were trying to read.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Cc: Patrick Vasseur <patrick.vasseur@c-s.fr>
Cc: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 6c23811e
......@@ -199,6 +199,8 @@ static int ad7923_read_raw(struct iio_dev *indio_dev,
if (chan->address == EXTRACT(ret, 12, 4))
*val = EXTRACT(ret, 0, 12);
else
return -EIO;
return IIO_VAL_INT;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册