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

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/adc/at91_adc.c

index 79c53b8e195c5de380b83afde3357d593ed4b1b9..5c8f690ce92f5e4f2d1a8d798d995ec7a0bf5fe3 100644 (file)
@@ -83,13 +83,7 @@ static irqreturn_t at91_adc_trigger_handler(int irq, void *p)
                j++;
        }
 
-       if (idev->scan_timestamp) {
-               s64 *timestamp = (s64 *)((u8 *)st->buffer +
-                                       ALIGN(j, sizeof(s64)));
-               *timestamp = pf->timestamp;
-       }
-
-       iio_push_to_buffers(idev, st->buffer);
+       iio_push_to_buffers_with_timestamp(idev, st->buffer, pf->timestamp);
 
        iio_trigger_notify_done(idev->trig);