iio:imu:inv_mpu6050: Use regmap_noinc_read for fifo reads.

We should not be assuming that we are reading a sequence of
registers as here we are doing a read of a lot of data from
a single register address.

Not marked for stable as by coincidence it being wrong doesn't
make any difference.

Suggested-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
Link: https://lore.kernel.org/r/20200722155103.979802-19-jic23@kernel.org
This commit is contained in:
Jonathan Cameron 2020-07-22 16:50:54 +01:00
parent 6b0cc5dce0
commit da83df6626
1 changed files with 2 additions and 2 deletions

View File

@ -179,8 +179,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
nb = fifo_count / bytes_per_datum;
inv_mpu6050_update_period(st, pf->timestamp, nb);
for (i = 0; i < nb; ++i) {
result = regmap_bulk_read(st->map, st->reg->fifo_r_w,
st->data, bytes_per_datum);
result = regmap_noinc_read(st->map, st->reg->fifo_r_w,
st->data, bytes_per_datum);
if (result)
goto flush_fifo;
/* skip first samples if needed */