mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
iio: health: max30100: 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: Matt Ranostay <mranostay@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
f7072198f2
commit
b74fccad75
1 changed files with 2 additions and 1 deletions
|
@ -238,12 +238,13 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)
|
||||||
|
|
||||||
mutex_lock(&data->lock);
|
mutex_lock(&data->lock);
|
||||||
|
|
||||||
while (cnt-- || (cnt = max30100_fifo_count(data) > 0)) {
|
while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
|
||||||
ret = max30100_read_measurement(data);
|
ret = max30100_read_measurement(data);
|
||||||
if (ret)
|
if (ret)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
iio_push_to_buffers(data->indio_dev, data->buffer);
|
iio_push_to_buffers(data->indio_dev, data->buffer);
|
||||||
|
cnt--;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&data->lock);
|
mutex_unlock(&data->lock);
|
||||||
|
|
Loading…
Add table
Reference in a new issue