aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <[email protected]>2021-10-04 16:44:54 +0300
committerJonathan Cameron <[email protected]>2021-10-19 08:30:24 +0100
commit2021ef0609009806829aa831f90c815bce1fe756 (patch)
tree2574ac75d9468eb46a937f1fb07cc42b257e6f82
parentd7a83bc38d8dd11b3df7e0db3739be6ced1667af (diff)
iio: adc: max1027: fix error code in max1027_wait_eoc()
Return -ETIMEDOUT on timeout instead of success. Fixes: 1f7b4048b31b ("iio: adc: max1027: Use the EOC IRQ when populated for single reads") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
-rw-r--r--drivers/iio/adc/max1027.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c
index fa4a2f48a36a..cb60b76a4d3a 100644
--- a/drivers/iio/adc/max1027.c
+++ b/drivers/iio/adc/max1027.c
@@ -287,7 +287,7 @@ static int max1027_wait_eoc(struct iio_dev *indio_dev)
msecs_to_jiffies(1000));
reinit_completion(&st->complete);
if (!ret)
- return ret;
+ return -ETIMEDOUT;
} else {
if (indio_dev->active_scan_mask)
conversion_time *= hweight32(*indio_dev->active_scan_mask);