From: Fugang Duan Date: Thu, 16 Jul 2015 06:49:09 +0000 (+0800) Subject: iio: adc: vf610: fix the adc register read fail issue X-Git-Tag: v3.16.35~1572 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54f22a7f92c33ad342693b1cac549c9b7a324273;p=thirdparty%2Fkernel%2Fstable.git iio: adc: vf610: fix the adc register read fail issue commit bf604a4c44a91cc2ceb60d4643a091b6b32cc999 upstream. Read the register only when the adc register address is 4 byte aligned. (rather than the other way around). Signed-off-by: Haibo Chen Signed-off-by: Fugang Duan Signed-off-by: Jonathan Cameron Signed-off-by: Luis Henriques --- diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c index 11048473b89eb..0062d0e71d03f 100644 --- a/drivers/iio/adc/vf610_adc.c +++ b/drivers/iio/adc/vf610_adc.c @@ -555,7 +555,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);