aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-09-19 08:59:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-09-21 14:23:58 -0400
commit01901d48fde9aeebe10199deb530e391b920392d (patch)
tree503802a7a5c76460249e042f131a0d4617ee77bd
parent419d8ce4eafbeb45303bdf94103ac07cc89ab5bb (diff)
iio:mpu6050: Use iio_push_to_buffers_with_timestamp()
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>
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
index 7da0832f187b..429517117eff 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_ring.c
@@ -124,7 +124,6 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
124 u8 data[INV_MPU6050_OUTPUT_DATA_SIZE]; 124 u8 data[INV_MPU6050_OUTPUT_DATA_SIZE];
125 u16 fifo_count; 125 u16 fifo_count;
126 s64 timestamp; 126 s64 timestamp;
127 u64 *tmp;
128 127
129 mutex_lock(&indio_dev->mlock); 128 mutex_lock(&indio_dev->mlock);
130 if (!(st->chip_config.accl_fifo_enable | 129 if (!(st->chip_config.accl_fifo_enable |
@@ -170,9 +169,8 @@ irqreturn_t inv_mpu6050_read_fifo(int irq, void *p)
170 if (0 == result) 169 if (0 == result)
171 timestamp = 0; 170 timestamp = 0;
172 171
173 tmp = (u64 *)data; 172 result = iio_push_to_buffers_with_timestamp(indio_dev, data,
174 tmp[DIV_ROUND_UP(bytes_per_datum, 8)] = timestamp; 173 timestamp);
175 result = iio_push_to_buffers(indio_dev, data);
176 if (result) 174 if (result)
177 goto flush_fifo; 175 goto flush_fifo;
178 fifo_count -= bytes_per_datum; 176 fifo_count -= bytes_per_datum;