Skip to contentSkip to conversation

drivers: staging: iio: cdc: fix return value

PATCH In review Thomas Preisner 2 participants 2 messages Dec 23, 2016 – Dec 30, 2016

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

PATCH 1/1 drivers: staging: iio: cdc: fix return value

At the end of function ad7150_write_event_config(), "return 0" seems improper. It may be better to return the value of ret.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188871

---
 drivers/staging/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/cdc/ad7150.c +1 -1
index 6998c3d..04861eb 100644
@@ -274,7 +274,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
 error_ret:
 	mutex_unlock(&chip->state_lock);
 
-	return 0;
+	return ret;
 }
 
 static int ad7150_read_event_value(struct iio_dev *indio_dev,
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 8 lines · Thomas Preisner

At the end of function ad7150_write_event_config(), "return 0" seems improper. It may be better to return the value of ret.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188871

I already see a patch for this from Pan.

Jonathan

Quoted 18 lines
---
 drivers/staging/iio/cdc/ad7150.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/iio/cdc/ad7150.c +1 -1
index 6998c3d..04861eb 100644
@@ -274,7 +274,7 @@ static int ad7150_write_event_config(struct iio_dev *indio_dev,
 error_ret:
 	mutex_unlock(&chip->state_lock);
 
-	return 0;
+	return ret;
 }
 
 static int ad7150_read_event_value(struct iio_dev *indio_dev,