linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] iio: light: tsl2583: return proper error code
@ 2016-10-19 10:32 Brian Masney
  2016-10-19 10:32 ` [PATCH 2/7] iio: light: tsl2583: change functions to only have a single exit point Brian Masney
                   ` (6 more replies)
  0 siblings, 7 replies; 27+ messages in thread
From: Brian Masney @ 2016-10-19 10:32 UTC (permalink / raw)
  To: jic23; +Cc: knaack.h, lars, pmeerw, gregkh, linux-iio, devel, linux-kernel

taos_gain_store() and taos_als_calibrate() both have a code path where
-1 was returned. This patch changes the code so that a proper error code
is returned to make the code consistent with the error paths that are
present within those same functions.

Signed-off-by: Brian Masney <masneyb@onstation.org>
---
 drivers/staging/iio/light/tsl2583.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 08f1583..1e42a19 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -359,7 +359,7 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 			!= (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON)) {
 		dev_err(&chip->client->dev,
 			"taos_als_calibrate failed: device not powered on with ADC enabled\n");
-		return -1;
+		return -ENODATA;
 	}
 
 	ret = i2c_smbus_write_byte(chip->client,
@@ -569,7 +569,7 @@ static ssize_t taos_gain_store(struct device *dev,
 		break;
 	default:
 		dev_err(dev, "Invalid Gain Index (must be 1,8,16,111)\n");
-		return -1;
+		return -EINVAL;
 	}
 
 	return len;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2016-10-24  9:36 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-19 10:32 [PATCH 1/7] iio: light: tsl2583: return proper error code Brian Masney
2016-10-19 10:32 ` [PATCH 2/7] iio: light: tsl2583: change functions to only have a single exit point Brian Masney
2016-10-19 11:08   ` Dan Carpenter
2016-10-19 12:38     ` Brian Masney
2016-10-19 12:51       ` Dan Carpenter
2016-10-19 10:32 ` [PATCH 3/7] iio: light: tsl2583: use DEVICE_ATTR_{RO, RW, WO} macros Brian Masney
2016-10-19 10:47   ` Peter Meerwald-Stadler
2016-10-19 13:04     ` Brian Masney
2016-10-19 11:26   ` Dan Carpenter
2016-10-19 13:08     ` Brian Masney
2016-10-19 13:11       ` Dan Carpenter
2016-10-22 17:25         ` Jonathan Cameron
2016-10-19 16:30   ` Jonathan Cameron
2016-10-19 10:32 ` [PATCH 4/7] iio: light: tsl2583: return proper error code in sysfs store functions Brian Masney
2016-10-19 10:32 ` [PATCH 5/7] iio: light: tsl2583: check return values from taos_chip_{on,off} Brian Masney
2016-10-19 11:22   ` [PATCH 5/7] iio: light: tsl2583: check return values from taos_chip_{on, off} Dan Carpenter
2016-10-19 12:48     ` Brian Masney
2016-10-19 12:54       ` Dan Carpenter
2016-10-19 12:57         ` Dan Carpenter
2016-10-19 10:32 ` [PATCH 6/7] iio: light: tsl2583: add locking to sysfs *_store() functions Brian Masney
2016-10-19 11:33   ` Dan Carpenter
2016-10-19 11:37     ` Dan Carpenter
2016-10-22 17:29       ` Jonathan Cameron
2016-10-24  9:35         ` Dan Carpenter
2016-10-19 10:32 ` [PATCH 7/7] iio: light: tsl2583: fix concurrency issue in taos_get_lux() Brian Masney
2016-10-22 17:32   ` Jonathan Cameron
2016-10-22 17:18 ` [PATCH 1/7] iio: light: tsl2583: return proper error code Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).