From: Lars-Peter Clausen Date: Thu, 19 Sep 2013 12:59:00 +0000 (+0100) Subject: iio:ad7923: Use iio_push_to_buffers_with_timestamp() X-Git-Tag: next-20130927~23^2~139^2~32 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9f4fa4f714241119ee9b0065648e58a2f7012cc9;p=karo-tx-linux.git iio:ad7923: Use iio_push_to_buffers_with_timestamp() Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen Signed-off-by: Jonathan Cameron --- 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) struct iio_poll_func *pf = p; struct iio_dev *indio_dev = pf->indio_dev; struct ad7923_state *st = iio_priv(indio_dev); - s64 time_ns = 0; int b_sent; b_sent = spi_sync(st->spi, &st->ring_msg); if (b_sent) goto done; - if (indio_dev->scan_timestamp) { - time_ns = iio_get_time_ns(); - memcpy((u8 *)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()); done: iio_trigger_notify_done(indio_dev->trig);