aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/accel/bma180.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-09-19 08:59:00 -0400
committerJonathan Cameron <jic23@kernel.org>2013-09-21 14:23:50 -0400
commit6bf9d87756d990dfca6a5102229271a9154362ba (patch)
treed52e37d76bccdc3b0f128f67a1c2bafabd94afd4 /drivers/iio/accel/bma180.c
parentd2c3d072c4aded65f0632223cc0d3a8a2e577b3a (diff)
iio:bma180: Use iio_push_buffers_with_timestamp()
Makes the code shorter and a bit less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/accel/bma180.c')
-rw-r--r--drivers/iio/accel/bma180.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c
index 3eff2469dba9..bda7a8343ddd 100644
--- a/drivers/iio/accel/bma180.c
+++ b/drivers/iio/accel/bma180.c
@@ -471,13 +471,10 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p)
471 struct iio_poll_func *pf = p; 471 struct iio_poll_func *pf = p;
472 struct iio_dev *indio_dev = pf->indio_dev; 472 struct iio_dev *indio_dev = pf->indio_dev;
473 struct bma180_data *data = iio_priv(indio_dev); 473 struct bma180_data *data = iio_priv(indio_dev);
474 int64_t time_ns = iio_get_time_ns();
474 int bit, ret, i = 0; 475 int bit, ret, i = 0;
475 476
476 mutex_lock(&data->mutex); 477 mutex_lock(&data->mutex);
477 if (indio_dev->scan_timestamp) {
478 ret = indio_dev->scan_bytes / sizeof(s64) - 1;
479 ((s64 *)data->buff)[ret] = iio_get_time_ns();
480 }
481 478
482 for_each_set_bit(bit, indio_dev->buffer->scan_mask, 479 for_each_set_bit(bit, indio_dev->buffer->scan_mask,
483 indio_dev->masklength) { 480 indio_dev->masklength) {
@@ -490,7 +487,7 @@ static irqreturn_t bma180_trigger_handler(int irq, void *p)
490 } 487 }
491 mutex_unlock(&data->mutex); 488 mutex_unlock(&data->mutex);
492 489
493 iio_push_to_buffers(indio_dev, data->buff); 490 iio_push_to_buffers_with_timestamp(indio_dev, data->buff, time_ns);
494err: 491err:
495 iio_trigger_notify_done(indio_dev->trig); 492 iio_trigger_notify_done(indio_dev->trig);
496 493