aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-09-19 08:59:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-09-21 14:23:53 -0400
commit5afd602b90f70e1fb6768165eb3efae28babe541 (patch)
tree18178c8598bb6194601216e1db1f87c506798062 /drivers/iio/adc
parentb05583a71deb5ec92e644c25aa5edbff249960c6 (diff)
iio:ad7887: 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>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/ad7887.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c
index 9dd077b78759..faedd0e165f6 100644
--- a/drivers/iio/adc/ad7887.c
+++ b/drivers/iio/adc/ad7887.c
@@ -121,20 +121,14 @@ static irqreturn_t ad7887_trigger_handler(int irq, void *p)
121 struct iio_poll_func *pf = p; 121 struct iio_poll_func *pf = p;
122 struct iio_dev *indio_dev = pf->indio_dev; 122 struct iio_dev *indio_dev = pf->indio_dev;
123 struct ad7887_state *st = iio_priv(indio_dev); 123 struct ad7887_state *st = iio_priv(indio_dev);
124 s64 time_ns;
125 int b_sent; 124 int b_sent;
126 125
127 b_sent = spi_sync(st->spi, st->ring_msg); 126 b_sent = spi_sync(st->spi, st->ring_msg);
128 if (b_sent) 127 if (b_sent)
129 goto done; 128 goto done;
130 129
131 time_ns = iio_get_time_ns(); 130 iio_push_to_buffers_with_timestamp(indio_dev, st->data,
132 131 iio_get_time_ns());
133 if (indio_dev->scan_timestamp)
134 memcpy(st->data + indio_dev->scan_bytes - sizeof(s64),
135 &time_ns, sizeof(time_ns));
136
137 iio_push_to_buffers(indio_dev, st->data);
138done: 132done:
139 iio_trigger_notify_done(indio_dev->trig); 133 iio_trigger_notify_done(indio_dev->trig);
140 134