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

iio:ad7476: 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
b05583a7 85ec2372

+2 -7
+2 -7
drivers/iio/adc/ad7476.c
··· 64 64 struct iio_poll_func *pf = p; 65 65 struct iio_dev *indio_dev = pf->indio_dev; 66 66 struct ad7476_state *st = iio_priv(indio_dev); 67 - s64 time_ns; 68 67 int b_sent; 69 68 70 69 b_sent = spi_sync(st->spi, &st->msg); 71 70 if (b_sent < 0) 72 71 goto done; 73 72 74 - time_ns = iio_get_time_ns(); 75 - 76 - if (indio_dev->scan_timestamp) 77 - ((s64 *)st->data)[1] = time_ns; 78 - 79 - iio_push_to_buffers(indio_dev, st->data); 73 + iio_push_to_buffers_with_timestamp(indio_dev, st->data, 74 + iio_get_time_ns()); 80 75 done: 81 76 iio_trigger_notify_done(indio_dev->trig); 82 77