iio:imu:inv_mpu6050: Use regmap_noinc_read for fifo reads.
authorJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 22 Jul 2020 15:50:54 +0000 (16:50 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 21 Sep 2020 19:01:51 +0000 (20:01 +0100)
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
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c

index d8e6b88ddffcb7121765ea95d3dd9c0e59498ca6..45c37525c2f1651698d8ddb4f2c81678e7169515 100644 (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 */