summaryrefslogtreecommitdiffstats
path: root/drivers/iio/health
diff options
context:
space:
mode:
authorMatt Ranostay <mranostay@gmail.com>2016-03-25 23:42:58 -0400
committerJonathan Cameron <jic23@kernel.org>2016-03-28 05:09:58 -0400
commitb74fccad751d2664bda9dd3c90646bb61295e774 (patch)
tree9b5f4d47c387baef71e51fbb378ebefbd4b49f85 /drivers/iio/health
parentf7072198f2178b68eabf25b439f17cfd8e070e9f (diff)
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>
Diffstat (limited to 'drivers/iio/health')
-rw-r--r--drivers/iio/health/max30100.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/iio/health/max30100.c b/drivers/iio/health/max30100.c
index 09db89359544..90ab8a2d2846 100644
--- a/drivers/iio/health/max30100.c
+++ b/drivers/iio/health/max30100.c
@@ -238,12 +238,13 @@ static irqreturn_t max30100_interrupt_handler(int irq, void *private)
238 238
239 mutex_lock(&data->lock); 239 mutex_lock(&data->lock);
240 240
241 while (cnt-- || (cnt = max30100_fifo_count(data) > 0)) { 241 while (cnt || (cnt = max30100_fifo_count(data) > 0)) {
242 ret = max30100_read_measurement(data); 242 ret = max30100_read_measurement(data);
243 if (ret) 243 if (ret)
244 break; 244 break;
245 245
246 iio_push_to_buffers(data->indio_dev, data->buffer); 246 iio_push_to_buffers(data->indio_dev, data->buffer);
247 cnt--;
247 } 248 }
248 249
249 mutex_unlock(&data->lock); 250 mutex_unlock(&data->lock);