提交 bf604a4c 编写于 作者: F Fugang Duan 提交者: Jonathan Cameron

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: NHaibo Chen <haibo.chen@freescale.com>
Signed-off-by: NFugang Duan <B38611@freescale.com>
Cc: <Stable.vger.kernel.org>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 c68a67b7
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册