Skip to content

Commit

Permalink
staging: iio: cdc/ad7746: fix missing return value
Browse files Browse the repository at this point in the history
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 <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Jonathan Cameron committed Oct 25, 2016
1 parent 3904b28 commit 3089ec2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/staging/iio/cdc/ad7746.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ static int ad7746_read_raw(struct iio_dev *indio_dev,
case IIO_VOLTAGE:
*val = ad7746_vt_filter_rate_table[
(chip->config >> 6) & 0x3][0];
ret = IIO_VAL_INT;
break;
default:
ret = -EINVAL;
Expand Down

0 comments on commit 3089ec2

Please sign in to comment.