staging: iio: tsl2583: return proper error code instead of -1
authorBrian Masney <masneyb@onstation.org>
Fri, 28 Oct 2016 10:00:14 +0000 (06:00 -0400)
committerJonathan Cameron <jic23@kernel.org>
Tue, 1 Nov 2016 18:50:04 +0000 (18:50 +0000)
taos_als_calibrate() has a code path where -1 is returned. This patch
changes the code so that a proper error code is returned.

Signed-off-by: Brian Masney <masneyb@onstation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
drivers/staging/iio/light/tsl2583.c

index 35c1696a71c579c056e9ba7000ce5f0fe3fafd67..47fd373e173469298241f7f9c995390e982eff62 100644 (file)
@@ -373,7 +373,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 -EINVAL;
        }
 
        ret = i2c_smbus_write_byte(chip->client,