diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-09-19 13:59:00 +0100 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2013-09-21 19:24:01 +0100 |
commit | c6f06818d0288ee9e53f39bd96f1814f62d80327 (patch) | |
tree | c853961c32480652051c4c94f894d8380c1c7e0f | |
parent | 5c757ac249c22560f34c523378eafdba37dab80d (diff) | |
download | linux-c6f06818d0288ee9e53f39bd96f1814f62d80327.tar.bz2 |
staging:iio:ad799x: 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/staging/iio/adc/ad799x_ring.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/staging/iio/adc/ad799x_ring.c b/drivers/staging/iio/adc/ad799x_ring.c index c2ebae12ee19..0ff6c03a483e 100644 --- a/drivers/staging/iio/adc/ad799x_ring.c +++ b/drivers/staging/iio/adc/ad799x_ring.c @@ -35,7 +35,6 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p) struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct ad799x_state *st = iio_priv(indio_dev); - s64 time_ns; int b_sent; u8 cmd; @@ -65,13 +64,8 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p) if (b_sent < 0) goto out; - time_ns = iio_get_time_ns(); - - if (indio_dev->scan_timestamp) - memcpy(st->rx_buf + indio_dev->scan_bytes - sizeof(s64), - &time_ns, sizeof(time_ns)); - - iio_push_to_buffers(indio_dev, st->rx_buf); + iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf, + iio_get_time_ns()); out: iio_trigger_notify_done(indio_dev->trig); |