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

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/iio_simple_dummy_buffer.c

index 3921865fecd624e26069f9b1d7ecc2606e8ac23d..09c93ac7351a5f052d04fbfb4742e52fa7f5ba76 100644 (file)
@@ -82,11 +82,8 @@ static irqreturn_t iio_simple_dummy_trigger_h(int irq, void *p)
                        len += 2;
                }
        }
-       /* Store the timestamp at an 8 byte aligned offset */
-       if (indio_dev->scan_timestamp)
-               *(s64 *)((u8 *)data + ALIGN(len, sizeof(s64)))
-                       = iio_get_time_ns();
-       iio_push_to_buffers(indio_dev, data);
+
+       iio_push_to_buffers_with_timestamp(indio_dev, data, iio_get_time_ns());
 
        kfree(data);