From 3b271798330ede49dc41615ce4eceb7a3aef8cd9 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Thu, 19 Sep 2013 13:59:00 +0100 Subject: [PATCH] iio:gp2ap020a00f: Use iio_push_to_buffers_with_timestamp() Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen Cc: Jacek Anaszewski Signed-off-by: Jonathan Cameron --- drivers/iio/light/gp2ap020a00f.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 62809b53a7f0..b1e4615b87e8 100644 --- a/drivers/iio/light/gp2ap020a00f.c +++ b/drivers/iio/light/gp2ap020a00f.c @@ -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); -- 2.30.2