iio:itg3200: 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:56 +0000 (19:23 +0100)
Makes the code a bit shorter and less ugly.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/gyro/itg3200_buffer.c

index 6b3c30118c484af1082206186e27fdcd3d67f2ee..e3b3c5084070d808ca88939e3f13257472ba3e55 100644 (file)
@@ -55,11 +55,8 @@ static irqreturn_t itg3200_trigger_handler(int irq, void *p)
        if (ret < 0)
                goto error_ret;
 
-       if (indio_dev->scan_timestamp)
-               memcpy(buf + indio_dev->scan_bytes - sizeof(s64),
-                               &pf->timestamp, sizeof(pf->timestamp));
+       iio_push_to_buffers_with_timestamp(indio_dev, buf, pf->timestamp);
 
-       iio_push_to_buffers(indio_dev, buf);
        iio_trigger_notify_done(indio_dev->trig);
 
 error_ret: