diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-09-19 08:59:00 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-21 14:23:52 -0400 |
commit | 85ec2372c8c0a9d1b2faf4057bc430ce8b939903 (patch) | |
tree | 855865f79701aba7bfb25d347cb5212f972dc8a7 /drivers/iio/adc | |
parent | fce8abfda40a764f4662ee354c1646ec78061371 (diff) |
iio:ad7298: 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/ad7298.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c index 0812556c11ff..2a3b65c74af9 100644 --- a/drivers/iio/adc/ad7298.c +++ b/drivers/iio/adc/ad7298.c | |||
@@ -159,20 +159,14 @@ static irqreturn_t ad7298_trigger_handler(int irq, void *p) | |||
159 | struct iio_poll_func *pf = p; | 159 | struct iio_poll_func *pf = p; |
160 | struct iio_dev *indio_dev = pf->indio_dev; | 160 | struct iio_dev *indio_dev = pf->indio_dev; |
161 | struct ad7298_state *st = iio_priv(indio_dev); | 161 | struct ad7298_state *st = iio_priv(indio_dev); |
162 | s64 time_ns = 0; | ||
163 | int b_sent; | 162 | int b_sent; |
164 | 163 | ||
165 | b_sent = spi_sync(st->spi, &st->ring_msg); | 164 | b_sent = spi_sync(st->spi, &st->ring_msg); |
166 | if (b_sent) | 165 | if (b_sent) |
167 | goto done; | 166 | goto done; |
168 | 167 | ||
169 | if (indio_dev->scan_timestamp) { | 168 | iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf, |
170 | time_ns = iio_get_time_ns(); | 169 | iio_get_time_ns()); |
171 | memcpy((u8 *)st->rx_buf + indio_dev->scan_bytes - sizeof(s64), | ||
172 | &time_ns, sizeof(time_ns)); | ||
173 | } | ||
174 | |||
175 | iio_push_to_buffers(indio_dev, st->rx_buf); | ||
176 | 170 | ||
177 | done: | 171 | done: |
178 | iio_trigger_notify_done(indio_dev->trig); | 172 | iio_trigger_notify_done(indio_dev->trig); |