iio: adc: vf610: fix the adc register read fail issue
Subsystems (2)
PATCH 1/1 iio: adc: vf610: fix the adc register read fail issue
Read the register only when the adc register address is 4 byte aligned.
Signed-off-by Haibo Chen <[email protected]>
Signed-off-by Fugang Duan <[email protected]>
--- drivers/iio/adc/vf610_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/adc/vf610_adc.c +1 -1
@@ -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);
Signature · 1 line
1.9.1
Quoted 4 lines · Fugang Duan
Read the register only when the adc register address is 4 byte aligned.
Signed-off-by Haibo Chen <[email protected]>Signed-off-by Fugang Duan <[email protected]>
Applied to the fixes-togreg branch of iio.git and marked for stable.
Quoted 18 lines
--- drivers/iio/adc/vf610_adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/adc/vf610_adc.c +1
-1@@ -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);