Skip to content

Commit

Permalink
iio: adc: vf610: fix the adc register read fail issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Fugang Duan authored and Jonathan Cameron committed Jul 19, 2015
1 parent c68a67b commit bf604a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iio/adc/vf610_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit bf604a4

Please sign in to comment.