iio:tcs3472: 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:59 +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/tcs3472.c

index 0b4ed57d746e09c80cee0208f5858617085479b8..45df2204614a866e77597d3bead60a16ac085e39 100644 (file)
@@ -192,10 +192,8 @@ static irqreturn_t tcs3472_trigger_handler(int irq, void *p)
                len += 2;
        }
 
-       if (indio_dev->scan_timestamp)
-               *(s64 *)((u8 *)data->buffer + ALIGN(len, sizeof(s64)))
-                       = iio_get_time_ns();
-       iio_push_to_buffers(indio_dev, data->buffer);
+       iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,
+               iio_get_time_ns());
 
 done:
        iio_trigger_notify_done(indio_dev->trig);