summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-09-19 14:59:00 +0200
committerJonathan Cameron <jic23@kernel.org>2013-09-21 20:23:52 +0200
commitb05583a71deb5ec92e644c25aa5edbff249960c6 (patch)
tree2761c00a0c0f5f23f2a1462fd8e571e23aa6d5af
parentiio:ad7298: Use iio_push_to_buffers_with_timestamp() (diff)
downloadlinux-b05583a71deb5ec92e644c25aa5edbff249960c6.tar.xz
linux-b05583a71deb5ec92e644c25aa5edbff249960c6.zip
iio:ad7476: Use iio_push_to_buffers_with_timestamp()
Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/adc/ad7476.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c
index 6d2b1d8d1a1f..8d808b9de909 100644
--- a/drivers/iio/adc/ad7476.c
+++ b/drivers/iio/adc/ad7476.c
@@ -64,19 +64,14 @@ static irqreturn_t ad7476_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev;
struct ad7476_state *st = iio_priv(indio_dev);
- s64 time_ns;
int b_sent;
b_sent = spi_sync(st->spi, &st->msg);
if (b_sent < 0)
goto done;
- time_ns = iio_get_time_ns();
-
- if (indio_dev->scan_timestamp)
- ((s64 *)st->data)[1] = time_ns;
-
- iio_push_to_buffers(indio_dev, st->data);
+ iio_push_to_buffers_with_timestamp(indio_dev, st->data,
+ iio_get_time_ns());
done:
iio_trigger_notify_done(indio_dev->trig);