[PATCH v2] iio: dac: ltc2688: fix voltage scale read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Properly set *val2 (and not overwrite *val) to correctly return
IIO_VAL_FRACTIONAL_LOG2.

Fixes: 832cb9eeb9312 ("iio: dac: add support for ltc2688")
Signed-off-by: Nuno Sá <nuno.sa@xxxxxxxxxx>
---
v2:
 * Fixed repeated "not" in commit description and tweaked patch subject
to match the preferred format.

 drivers/iio/dac/ltc2688.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/dac/ltc2688.c b/drivers/iio/dac/ltc2688.c
index d249fa28202c..937b0d25a11c 100644
--- a/drivers/iio/dac/ltc2688.c
+++ b/drivers/iio/dac/ltc2688.c
@@ -298,7 +298,7 @@ static int ltc2688_read_raw(struct iio_dev *indio_dev,
 		if (ret)
 			return ret;
 
-		*val = 16;
+		*val2 = 16;
 		return IIO_VAL_FRACTIONAL_LOG2;
 	case IIO_CHAN_INFO_CALIBBIAS:
 		ret = regmap_read(st->regmap,
-- 
2.35.1




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux