Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1508554

[PATCH] staging: iio: cdc: ad7746: set ret on IIO_VOLTAGE case

From Colin King <colin.king@canonical.com>
Newsgroups linux.kernel
Subject [PATCH] staging: iio: cdc: ad7746: set ret on IIO_VOLTAGE case
Date 2016-10-25 20:50 +0200
Message-ID <sweXo-W6-15@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Colin Ian King <colin.king@canonical.com>

For a IIO_VOLTAGE case, ret is not being set causing an
uninitialized value being returned by ad7746_read_raw. Fix
this by setting ret to IIO_VAL_INT for this specific case.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/staging/iio/cdc/ad7746.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c
index f41251c..a5828f9 100644
--- a/drivers/staging/iio/cdc/ad7746.c
+++ b/drivers/staging/iio/cdc/ad7746.c
@@ -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;
-- 
2.9.3

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] staging: iio: cdc: ad7746: set ret on IIO_VOLTAGE case Colin King <colin.king@canonical.com> - 2016-10-25 20:50 +0200
  Re: [PATCH] staging: iio: cdc: ad7746: set ret on IIO_VOLTAGE case Lars-Peter Clausen <lars@metafoo.de> - 2016-10-25 21:00 +0200

csiph-web