From f1a5e64dd871b2904aa7cc340a86fd5bcd86bebe Mon Sep 17 00:00:00 2001 From: Zorro Liu Date: Tue, 23 Aug 2016 15:00:00 +0800 Subject: [PATCH] driver,mpu6500: improve readfifo while (fifo_count == 0) && (kfifo_len(&st->timestamps) > 0) then flush fifo Change-Id: I9b4ab975d708ee1bb02435bca933ce8f3b55e037 Signed-off-by: Zorro Liu --- drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c b/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c index d8558d75c70d..bfff9c5d48c9 100644 --- a/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c +++ b/drivers/staging/iio/imu/inv_mpu/inv_mpu_ring.c @@ -1002,7 +1002,7 @@ irqreturn_t inv_read_fifo(int irq, void *dev_id) if (result) goto end_session; fifo_count = be16_to_cpup((__be16 *)(&data[0])); - if (fifo_count == 0) + if ((fifo_count == 0) && (kfifo_len(&st->timestamps) > 0)) goto flush_fifo; if (fifo_count < bytes_per_datum) goto end_session; -- 2.34.1