Skip to contentSkip to conversation

iio: dac: ltc2688: fix voltage scale read

PATCH In review Nuno Sá 2 participants 2 messages Apr 12, 2022 – Apr 16, 2022

Subsystems (2)
lore
Share & tools
lore

Nuno Sá

author maintainer
#0 lore raw

PATCH v2 1/1 iio: dac: ltc2688: fix voltage scale read

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

Fixes 832cb9eeb9312 ("iio: dac: add support for ltc2688")

---
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(-)
drivers/iio/dac/ltc2688.c +1 -1
index d249fa28202c..937b0d25a11c 100644
@@ -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,
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 5 lines · On Tue, 12 Apr 2022 14:49:16 +0200 Nuno Sá <[email protected]> wrote:

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

Fixes 832cb9eeb9312 ("iio: dac: add support for ltc2688")

Dropped v1 and applied this instead.

If you detect an issue with a patch you have sent yourself, it is helpful to reply to that patch to make it clear there will be a v2.
I don't always catch up with all my email in one sitting so can end up pushing the wrong versions out....

Thanks,

Jonathan

Quoted 21 lines

---
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(-)
drivers/iio/dac/ltc2688.c +1 -1
index d249fa28202c..937b0d25a11c 100644
@@ -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,