driver,mpu6500: improve readfifo

while (fifo_count == 0) && (kfifo_len(&st->timestamps) > 0) then flush fifo

Change-Id: I9b4ab975d708ee1bb02435bca933ce8f3b55e037
Signed-off-by: Zorro Liu <lyx@rock-chips.com>
This commit is contained in:
Zorro Liu
2016-08-23 15:00:00 +08:00
committed by Huang, Tao
parent 6e4ff77147
commit f1a5e64dd8

View File

@@ -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;