iio:gp2ap020a00f: 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: Jacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/iio/light/gp2ap020a00f.c

index 62809b53a7f00ec718ed3725dabbd47de41645f6..b1e4615b87e8813e8e7819a0021bb12e26ca9fa4 100644 (file)
@@ -988,13 +988,8 @@ static irqreturn_t gp2ap020a00f_trigger_handler(int irq, void *data)
                }
        }
 
-       if (indio_dev->scan_timestamp) {
-               s64 *timestamp = (s64 *)((u8 *)priv->buffer +
-                                               ALIGN(d_size, sizeof(s64)));
-               *timestamp = pf->timestamp;
-       }
-
-       iio_push_to_buffers(indio_dev, priv->buffer);
+       iio_push_to_buffers_with_timestamp(indio_dev, priv->buffer,
+               pf->timestamp);
 done:
        iio_trigger_notify_done(indio_dev->trig);