Commit 3089ec2c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Cameron

staging: iio: cdc/ad7746: fix missing return value

As found by "gcc -Wmaybe-uninitialized", the latest change to the
driver lacked an initalization for the return code in one of the
added cases:

drivers/staging/iio/cdc/ad7746.c: In function ‘ad7746_read_raw’:
drivers/staging/iio/cdc/ad7746.c:655:2: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

This sets it to IIO_VAL_INT, which I think is what we want here.

Fixes: 2296c062 ("staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQ")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 3904b28e
...@@ -642,6 +642,7 @@ static int ad7746_read_raw(struct iio_dev *indio_dev, ...@@ -642,6 +642,7 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
case IIO_VOLTAGE: case IIO_VOLTAGE:
*val = ad7746_vt_filter_rate_table[ *val = ad7746_vt_filter_rate_table[
(chip->config >> 6) & 0x3][0]; (chip->config >> 6) & 0x3][0];
ret = IIO_VAL_INT;
break; break;
default: default:
ret = -EINVAL; ret = -EINVAL;
......
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