Skip to content

Commit 3089ec2

Browse files
arndbjic23
authored andcommitted
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: 2296c06 ("staging: iio: cdc: ad7746: implement IIO_CHAN_INFO_SAMP_FREQ") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 3904b28 commit 3089ec2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/staging/iio/cdc/ad7746.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
642642
case IIO_VOLTAGE:
643643
*val = ad7746_vt_filter_rate_table[
644644
(chip->config >> 6) & 0x3][0];
645+
ret = IIO_VAL_INT;
645646
break;
646647
default:
647648
ret = -EINVAL;

0 commit comments

Comments
 (0)