All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] iio: adc: vf610: fix the adc register read fail issue
@ 2015-07-16  6:49 Fugang Duan
  2015-07-19 12:30 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Fugang Duan @ 2015-07-16  6:49 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio

Read the register only when the adc register address is 4 byte aligned.

Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
---
 drivers/iio/adc/vf610_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 480f335..819632b 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -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);
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] iio: adc: vf610: fix the adc register read fail issue
  2015-07-16  6:49 [PATCH 1/1] iio: adc: vf610: fix the adc register read fail issue Fugang Duan
@ 2015-07-19 12:30 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2015-07-19 12:30 UTC (permalink / raw)
  To: Fugang Duan; +Cc: linux-iio

On 16/07/15 07:49, Fugang Duan wrote:
> Read the register only when the adc register address is 4 byte aligned.
> 
> Signed-off-by: Haibo Chen <haibo.chen@freescale.com>
> Signed-off-by: Fugang Duan <B38611@freescale.com>
Applied to the fixes-togreg branch of iio.git and marked for stable.
> ---
>  drivers/iio/adc/vf610_adc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
> index 480f335..819632b 100644
> --- a/drivers/iio/adc/vf610_adc.c
> +++ b/drivers/iio/adc/vf610_adc.c
> @@ -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);
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-19 12:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-16  6:49 [PATCH 1/1] iio: adc: vf610: fix the adc register read fail issue Fugang Duan
2015-07-19 12:30 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.