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:53 -0400 |
commit | 9f4fa4f714241119ee9b0065648e58a2f7012cc9 (patch) | |
tree | 8ee86877886cb87aa6b11c25cb2de39ee1ded1cb | |
parent | 5afd602b90f70e1fb6768165eb3efae28babe541 (diff) |
iio:ad7923: 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/ad7923.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/iio/adc/ad7923.c b/drivers/iio/adc/ad7923.c index 7eb4cb5a7f0d..28732c28e819 100644 --- a/drivers/iio/adc/ad7923.c +++ b/drivers/iio/adc/ad7923.c | |||
@@ -174,20 +174,14 @@ static irqreturn_t ad7923_trigger_handler(int irq, void *p) | |||
174 | struct iio_poll_func *pf = p; | 174 | struct iio_poll_func *pf = p; |
175 | struct iio_dev *indio_dev = pf->indio_dev; | 175 | struct iio_dev *indio_dev = pf->indio_dev; |
176 | struct ad7923_state *st = iio_priv(indio_dev); | 176 | struct ad7923_state *st = iio_priv(indio_dev); |
177 | s64 time_ns = 0; | ||
178 | int b_sent; | 177 | int b_sent; |
179 | 178 | ||
180 | b_sent = spi_sync(st->spi, &st->ring_msg); | 179 | b_sent = spi_sync(st->spi, &st->ring_msg); |
181 | if (b_sent) | 180 | if (b_sent) |
182 | goto done; | 181 | goto done; |
183 | 182 | ||
184 | if (indio_dev->scan_timestamp) { | 183 | iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf, |
185 | time_ns = iio_get_time_ns(); | 184 | iio_get_time_ns()); |
186 | memcpy((u8 *)st->rx_buf + indio_dev->scan_bytes - sizeof(s64), | ||
187 | &time_ns, sizeof(time_ns)); | ||
188 | } | ||
189 | |||
190 | iio_push_to_buffers(indio_dev, st->rx_buf); | ||
191 | 185 | ||
192 | done: | 186 | done: |
193 | iio_trigger_notify_done(indio_dev->trig); | 187 | iio_trigger_notify_done(indio_dev->trig); |