Commit c6f06818 authored by Lars-Peter Clausen's avatar Lars-Peter Clausen Committed by Jonathan Cameron

staging:iio:ad799x: Use iio_push_to_buffers_with_timestamp()

Makes the code a bit shorter and less ugly.
Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 5c757ac2
...@@ -35,7 +35,6 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p) ...@@ -35,7 +35,6 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p)
struct iio_poll_func *pf = p; struct iio_poll_func *pf = p;
struct iio_dev *indio_dev = pf->indio_dev; struct iio_dev *indio_dev = pf->indio_dev;
struct ad799x_state *st = iio_priv(indio_dev); struct ad799x_state *st = iio_priv(indio_dev);
s64 time_ns;
int b_sent; int b_sent;
u8 cmd; u8 cmd;
...@@ -65,13 +64,8 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p) ...@@ -65,13 +64,8 @@ static irqreturn_t ad799x_trigger_handler(int irq, void *p)
if (b_sent < 0) if (b_sent < 0)
goto out; goto out;
time_ns = iio_get_time_ns(); iio_push_to_buffers_with_timestamp(indio_dev, st->rx_buf,
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);
out: out:
iio_trigger_notify_done(indio_dev->trig); iio_trigger_notify_done(indio_dev->trig);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment