summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorFugang Duan <b38611@freescale.com>2015-07-16 14:49:09 +0800
committerJonathan Cameron <jic23@kernel.org>2015-07-19 13:35:26 +0100
commitbf604a4c44a91cc2ceb60d4643a091b6b32cc999 (patch)
tree66b4704167a01f12580c62a5d2dde8777d67bccb /drivers/iio
parentc68a67b7adeec240bd79780635dc0ce74d0cb61a (diff)
downloadtalos-obmc-linux-bf604a4c44a91cc2ceb60d4643a091b6b32cc999.tar.gz
talos-obmc-linux-bf604a4c44a91cc2ceb60d4643a091b6b32cc999.zip
iio: adc: vf610: fix the adc register read fail issue
Read the register only when the adc register address is 4 byte aligned. (rather than the other way around). Signed-off-by: Haibo Chen <haibo.chen@freescale.com> Signed-off-by: Fugang Duan <B38611@freescale.com> Cc: <Stable.vger.kernel.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/vf610_adc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 480f335a0f9f..819632bf1fda 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -635,7 +635,7 @@ static int vf610_adc_reg_access(struct iio_dev *indio_dev,
struct vf610_adc *info = iio_priv(indio_dev);
if ((readval == NULL) ||
- (!(reg % 4) || (reg > VF610_REG_ADC_PCTL)))
+ ((reg % 4) || (reg > VF610_REG_ADC_PCTL)))
return -EINVAL;
*readval = readl(info->regs + reg);
OpenPOWER on IntegriCloud