Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Lars-Peter Clausen and committed by
Jonathan Cameron
5afd602b b05583a7

+2 -8
+2 -8
drivers/iio/adc/ad7887.c
··· 121 121 struct iio_poll_func *pf = p; 122 122 struct iio_dev *indio_dev = pf->indio_dev; 123 123 struct ad7887_state *st = iio_priv(indio_dev); 124 - s64 time_ns; 125 124 int b_sent; 126 125 127 126 b_sent = spi_sync(st->spi, st->ring_msg); 128 127 if (b_sent) 129 128 goto done; 130 129 131 - time_ns = iio_get_time_ns(); 132 - 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); 130 + iio_push_to_buffers_with_timestamp(indio_dev, st->data, 131 + iio_get_time_ns()); 138 132 done: 139 133 iio_trigger_notify_done(indio_dev->trig); 140 134