aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/light/vcnl4000.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2020-02-03 10:17:01 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2020-02-14 15:06:24 +0000
commit4a818643e9886c66ba65439a1cd9001c800d6fe1 (patch)
tree88df336d531fc5ef5b09be93c1d800f04905965e /drivers/iio/light/vcnl4000.c
parentiio: dac: ltc2632: remove some unused defines (diff)
downloadlinux-dev-4a818643e9886c66ba65439a1cd9001c800d6fe1.tar.xz
linux-dev-4a818643e9886c66ba65439a1cd9001c800d6fe1.zip
iio: vcnl4000: Use a single return when getting IIO_CHAN_INFO_RAW
This will be useful when introducing runtime pm. Signed-off-by: Guido Günther <agx@sigxcpu.org> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light/vcnl4000.c')
-rw-r--r--drivers/iio/light/vcnl4000.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index b0e241aaefb4..8f198383626b 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -335,17 +335,18 @@ static int vcnl4000_read_raw(struct iio_dev *indio_dev,
switch (chan->type) {
case IIO_LIGHT:
ret = data->chip_spec->measure_light(data, val);
- if (ret < 0)
- return ret;
- return IIO_VAL_INT;
+ if (!ret)
+ ret = IIO_VAL_INT;
+ break;
case IIO_PROXIMITY:
ret = data->chip_spec->measure_proximity(data, val);
- if (ret < 0)
- return ret;
- return IIO_VAL_INT;
+ if (!ret)
+ ret = IIO_VAL_INT;
+ break;
default:
- return -EINVAL;
+ ret = -EINVAL;
}
+ return ret;
case IIO_CHAN_INFO_SCALE:
if (chan->type != IIO_LIGHT)
return -EINVAL;