Skip to content

Commit 03fada4

Browse files
Mehdi Djaitjic23
authored andcommitted
iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
The trigger_handler gets called from the IRQ thread handler using iio_trigger_poll_chained() which will only call the bottom half of the pollfunc and therefore pf->timestamp will not get set. Use instead the timestamp from the driver's private data which is always set in the IRQ handler. Fixes: 7c1d167 ("iio: accel: Support Kionix/ROHM KX022A accelerometer") Link: https://lore.kernel.org/linux-iio/Y+6QoBLh1k82cJVN@carbian/ Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com> Link: https://lore.kernel.org/r/20230218135111.90061-1-mehdi.djait.k@gmail.com Cc: <Stable@vger.kernel.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
1 parent 0c6ef98 commit 03fada4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/accel/kionix-kx022a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
864864
if (ret < 0)
865865
goto err_read;
866866

867-
iio_push_to_buffers_with_timestamp(idev, data->buffer, pf->timestamp);
867+
iio_push_to_buffers_with_timestamp(idev, data->buffer, data->timestamp);
868868
err_read:
869869
iio_trigger_notify_done(idev->trig);
870870

0 commit comments

Comments
 (0)