mirror of
https://github.com/torvalds/linux
synced 2024-10-17 08:46:50 +00:00
iio: light: apds9960: silence uninitialized variable warning
It causes a static checker warning if we use "buf" on the failure path so move that inside the if statement. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
eb3798463f
commit
f21122593d
|
@ -495,9 +495,10 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
|
||||||
case IIO_INTENSITY:
|
case IIO_INTENSITY:
|
||||||
ret = regmap_bulk_read(data->regmap, chan->address,
|
ret = regmap_bulk_read(data->regmap, chan->address,
|
||||||
&buf, 2);
|
&buf, 2);
|
||||||
if (!ret)
|
if (!ret) {
|
||||||
ret = IIO_VAL_INT;
|
ret = IIO_VAL_INT;
|
||||||
*val = le16_to_cpu(buf);
|
*val = le16_to_cpu(buf);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
|
Loading…
Reference in a new issue