Skip to contentSkip to conversation

iio: adc: max1027: fix error code in max1027_wait_eoc()

PATCH Applied Dan Carpenter 3 participants 3 messages Oct 4, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: adc: max1027: fix error code in max1027_wait_eoc()

Return -ETIMEDOUT on timeout instead of success.

Fixes 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
---
 drivers/iio/adc/max1027.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/max1027.c +1 -1
index 45dc8a625fa3..4daf1d576c4e 100644
@@ -286,7 +286,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);
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hello,

[email protected] wrote on Mon, 4 Oct 2021 16:44:54 +0300:

Quoted 13 lines

Return -ETIMEDOUT on timeout instead of success.

Fixes 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
---
 drivers/iio/adc/max1027.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/max1027.c +0 -0
index 45dc8a625fa3..4daf1d576c4e 100644

drivers/iio/adc/max1027.c static int max1027_wait_eoc(struct iio_dev *indio_dev) · line 289

Quoted 5 lines
drivers/iio/adc/max1027.c +1 -1
@@ -286,7 +286,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;

drivers/iio/adc/max1027.c static int max1027_wait_eoc(struct iio_dev *indio_dev) · line 292

Quoted 3 lines
drivers/iio/adc/max1027.c +0 -0
 	} else {
 		if (indio_dev->active_scan_mask)
 			conversion_time *= hweight32(*indio_dev->active_scan_mask);

Thanks,
Miquèl

maintainer Applied
#2 lore raw
Quoted 12 lines · On Mon, 4 Oct 2021 16:17:11 +0200 Miquel Raynal <[email protected]>…

Hello,

[email protected] wrote on Mon, 4 Oct 2021 16:44:54 +0300:

Quoted 8 lines

Return -ETIMEDOUT on timeout instead of success.

Fixes 54f14be01e17 ("iio: adc: max1027: Use the EOC IRQ when populated for single reads")
---
 drivers/iio/adc/max1027.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/iio/adc/max1027.c static int max1027_wait_eoc(struct iio_dev *indio_dev) · line 289

Quoted 10 lines
drivers/iio/adc/max1027.c +1 -1
index 45dc8a625fa3..4daf1d576c4e 100644
@@ -286,7 +286,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;  

Applied to the togreg branch of iio.git.

As this is the only patch I've applied today I've just pushed it out directly for next to pick up rather than going through the normal initial push to testing for 0-day.

Thanks,

Jonathan

Quoted 8 lines

drivers/iio/adc/max1027.c static int max1027_wait_eoc(struct iio_dev *indio_dev) · line 292

Quoted 4 lines
drivers/iio/adc/max1027.c +0 -0
 	} else {
 		if (indio_dev->active_scan_mask)
 			conversion_time *= hweight32(*indio_dev->active_scan_mask);  

Thanks,
Miquèl