提交 655048a0 编写于 作者: M Matt Ranostay 提交者: Jonathan Cameron

iio: light: apds9960: correct FIFO check condition

Correct issue that the last entry in FIFO was being read twice due
to an incorrect decrement of entry count variable before condition
check.
Signed-off-by: NMatt Ranostay <mranostay@gmail.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 5c913eb9
......@@ -769,7 +769,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
mutex_lock(&data->lock);
data->gesture_mode_running = 1;
while (cnt-- || (cnt = apds9660_fifo_is_empty(data) > 0)) {
while (cnt || (cnt = apds9660_fifo_is_empty(data) > 0)) {
ret = regmap_bulk_read(data->regmap, APDS9960_REG_GFIFO_BASE,
&data->buffer, 4);
......@@ -777,6 +777,7 @@ static void apds9960_read_gesture_fifo(struct apds9960_data *data)
goto err_read;
iio_push_to_buffers(data->indio_dev, data->buffer);
cnt--;
}
err_read:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册