mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
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>
This commit is contained in:
parent
c68a67b7ad
commit
bf604a4c44
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue