Commit 20d823af authored by Brian Masney's avatar Brian Masney Committed by Jonathan Cameron

staging: iio: tsl2583: return proper error code instead of -1

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: default avatarBrian Masney <masneyb@onstation.org>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 9d5f36d2
...@@ -373,7 +373,7 @@ static int taos_als_calibrate(struct iio_dev *indio_dev) ...@@ -373,7 +373,7 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
!= (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON)) { != (TSL258X_CNTL_ADC_ENBL | TSL258X_CNTL_PWR_ON)) {
dev_err(&chip->client->dev, dev_err(&chip->client->dev,
"taos_als_calibrate failed: device not powered on with ADC enabled\n"); "taos_als_calibrate failed: device not powered on with ADC enabled\n");
return -1; return -EINVAL;
} }
ret = i2c_smbus_write_byte(chip->client, ret = i2c_smbus_write_byte(chip->client,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment