iio:adjd_s311: 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: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/adjd_s311.c

index c9c8b002b27d72b6d07276651fd32aa9bd9f2cc8..39f639241e815e77f1c7cd2f1b9c9fe99e898b52 100644 (file)
@@ -138,10 +138,7 @@ static irqreturn_t adjd_s311_trigger_handler(int irq, void *p)
                len += 2;
        }
 
-       if (indio_dev->scan_timestamp)
-               *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
-                       = time_ns;
-       iio_push_to_buffers(indio_dev, data->buffer);
+       iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, time_ns);
 
 done:
        iio_trigger_notify_done(indio_dev->trig);