summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Fertic <jeremyfertic@gmail.com>2018-12-11 17:55:00 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-16 09:17:20 +0200
commit4e12fe2e5520d11084826d339b7b37191c6d4c83 (patch)
treed34a6e3bdf64d9a1086634034ce3294f00558bda
parent19a81333239e0886fdbea8a8f622f855131285ed (diff)
downloadlinux-stable-4e12fe2e5520d11084826d339b7b37191c6d4c83.tar.gz
linux-stable-4e12fe2e5520d11084826d339b7b37191c6d4c83.tar.bz2
linux-stable-4e12fe2e5520d11084826d339b7b37191c6d4c83.zip
staging: iio: adt7316: allow adt751x to use internal vref for all dacs
commit 10bfe7cc1739c22f0aa296b39e53f61e9e3f4d99 upstream. With adt7516/7/9, internal vref is available for dacs a and b, dacs c and d, or all dacs. The driver doesn't currently support internal vref for all dacs. Change the else if to an if so both bits are checked rather than just one or the other. Signed-off-by: Jeremy Fertic <jeremyfertic@gmail.com> Fixes: 35f6b6b86ede ("staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver") Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/iio/addac/adt7316.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index 5b11b42c0254..2f2e3a973ce1 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -1092,7 +1092,7 @@ static ssize_t adt7316_store_DAC_internal_Vref(struct device *dev,
ldac_config = chip->ldac_config & (~ADT7516_DAC_IN_VREF_MASK);
if (data & 0x1)
ldac_config |= ADT7516_DAC_AB_IN_VREF;
- else if (data & 0x2)
+ if (data & 0x2)
ldac_config |= ADT7516_DAC_CD_IN_VREF;
} else {
ret = kstrtou8(buf, 16, &data);