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

staging:iio:adis16130: Fix sample reading

The driver first does a proper read of the data register, but right after that
it does a spi_read, which will overwrite the initial result.

It looks as if the extra spi_read was accidentally introduced in commit
a5e7363c ("staging:iio:gyro:adis16130 drop control of adc resolution."), quite
likely due to a bad rebase.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 fe791121
...@@ -62,7 +62,6 @@ static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val) ...@@ -62,7 +62,6 @@ static int adis16130_spi_read(struct iio_dev *indio_dev, u8 reg_addr, u32 *val)
spi_message_init(&msg); spi_message_init(&msg);
spi_message_add_tail(&xfer, &msg); spi_message_add_tail(&xfer, &msg);
ret = spi_sync(st->us, &msg); ret = spi_sync(st->us, &msg);
ret = spi_read(st->us, st->buf, 4);
if (ret == 0) if (ret == 0)
*val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3]; *val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册