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

iio:max1363: 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 e79cece0
...@@ -1436,7 +1436,6 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p) ...@@ -1436,7 +1436,6 @@ static irqreturn_t max1363_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 max1363_state *st = iio_priv(indio_dev); struct max1363_state *st = iio_priv(indio_dev);
s64 time_ns;
__u8 *rxbuf; __u8 *rxbuf;
int b_sent; int b_sent;
size_t d_size; size_t d_size;
...@@ -1470,11 +1469,7 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p) ...@@ -1470,11 +1469,7 @@ static irqreturn_t max1363_trigger_handler(int irq, void *p)
if (b_sent < 0) if (b_sent < 0)
goto done_free; goto done_free;
time_ns = iio_get_time_ns(); iio_push_to_buffers_with_timestamp(indio_dev, rxbuf, iio_get_time_ns());
if (indio_dev->scan_timestamp)
memcpy(rxbuf + d_size - sizeof(s64), &time_ns, sizeof(time_ns));
iio_push_to_buffers(indio_dev, rxbuf);
done_free: done_free:
kfree(rxbuf); kfree(rxbuf);
......
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