提交 f2112259 编写于 作者: D Dan Carpenter 提交者: Jonathan Cameron

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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 eb379846
......@@ -495,9 +495,10 @@ static int apds9960_read_raw(struct iio_dev *indio_dev,
case IIO_INTENSITY:
ret = regmap_bulk_read(data->regmap, chan->address,
&buf, 2);
if (!ret)
if (!ret) {
ret = IIO_VAL_INT;
*val = le16_to_cpu(buf);
*val = le16_to_cpu(buf);
}
break;
default:
ret = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册