From: Lars-Peter Clausen Date: Thu, 19 Sep 2013 12:59:00 +0000 (+0100) Subject: iio:gp2ap020a00f: Use iio_push_to_buffers_with_timestamp() X-Git-Tag: v3.13-rc1~170^2~694^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b271798330ede49dc41615ce4eceb7a3aef8cd9;p=platform%2Fkernel%2Flinux-exynos.git 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 --- diff --git a/drivers/iio/light/gp2ap020a00f.c b/drivers/iio/light/gp2ap020a00f.c index 62809b5..b1e4615 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);