iio:mpu6050: Use iio_push_to_buffers_with_timestamp()
authorLars-Peter Clausen <lars@metafoo.de>
Thu, 19 Sep 2013 12:59:00 +0000 (13:59 +0100)
committerJonathan Cameron <jic23@kernel.org>
Sat, 21 Sep 2013 18:23:58 +0000 (19:23 +0100)
Makes the code a bit shorter and less ugly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Ge Gao <ggao@invensense.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c

index 7da0832f187b8d320cd8618eb3379b2015bee927..429517117eff43d92b86238a284635c8b3b4b8f9 100644 (file)
@@ -124,7 +124,6 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
        u8 data[INV_MPU6050_OUTPUT_DATA_SIZE];
        u16 fifo_count;
        s64 timestamp;
-       u64 *tmp;
 
        mutex_lock(&indio_dev->mlock);
        if (!(st->chip_config.accl_fifo_enable |
@@ -170,9 +169,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
                if (0 == result)
                        timestamp = 0;
 
-               tmp = (u64 *)data;
-               tmp[DIV_ROUND_UP(bytes_per_datum, 8)] = timestamp;
-               result = iio_push_to_buffers(indio_dev, data);
+               result = iio_push_to_buffers_with_timestamp(indio_dev, data,
+                       timestamp);
                if (result)
                        goto flush_fifo;
                fifo_count -= bytes_per_datum;