All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling
@ 2015-02-02  8:35 Nicholas Mc Guire
  2015-02-04 17:01 ` Jonathan Cameron
  2015-02-06  6:05 ` sanjeev sharma
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2015-02-02  8:35 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Fabio Estevam, Fugang Duan, Sanjeev Sharma, Sanchayan Maity,
	linux-iio, linux-kernel, Nicholas Mc Guire

return type of wait_for_completion_timeout is unsigned long not int, this
patch only fixes up the return handling.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---
 drivers/iio/adc/vf610_adc.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Rather than changing timeout to unsigned long it can be moved into the
if condition and dropped.

Patch was compile tested only for imx_v6_v7_defconfig + CONFIG_IIO=m,
CONFIG_VF610_ADC=m

Patch is against 3.19.0-rc6 -next-20150130

diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
index 8ec353c..5b72d17 100644
--- a/drivers/iio/adc/vf610_adc.c
+++ b/drivers/iio/adc/vf610_adc.c
@@ -259,7 +259,6 @@ static void vf610_adc_cfg_post_set(struct vf610_adc *info)
 static void vf610_adc_calibration(struct vf610_adc *info)
 {
 	int adc_gc, hc_cfg;
-	int timeout;
 
 	if (!info->adc_feature.calibration)
 		return;
@@ -271,9 +270,7 @@ static void vf610_adc_calibration(struct vf610_adc *info)
 	adc_gc = readl(info->regs + VF610_REG_ADC_GC);
 	writel(adc_gc | VF610_ADC_CAL, info->regs + VF610_REG_ADC_GC);
 
-	timeout = wait_for_completion_timeout
-			(&info->completion, VF610_ADC_TIMEOUT);
-	if (timeout == 0)
+	if (!wait_for_completion_timeout(&info->completion, VF610_ADC_TIMEOUT))
 		dev_err(info->dev, "Timeout for adc calibration\n");
 
 	adc_gc = readl(info->regs + VF610_REG_ADC_GS);
-- 
1.7.10.4


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

* Re: [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling
  2015-02-02  8:35 [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling Nicholas Mc Guire
@ 2015-02-04 17:01 ` Jonathan Cameron
  2015-02-06  6:05 ` sanjeev sharma
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2015-02-04 17:01 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald,
	Fabio Estevam, Fugang Duan, Sanjeev Sharma, Sanchayan Maity,
	linux-iio, linux-kernel

On 02/02/15 08:35, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int, this
> patch only fixes up the return handling.
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied to the togreg branch of iio.git which will at somepoint get
pushed out as testing for the autobuilders to play with. 
If anyone has comments still plenty of time before I push this out
properly!

J
> ---
>  drivers/iio/adc/vf610_adc.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> Rather than changing timeout to unsigned long it can be moved into the
> if condition and dropped.
> 
> Patch was compile tested only for imx_v6_v7_defconfig + CONFIG_IIO=m,
> CONFIG_VF610_ADC=m
> 
> Patch is against 3.19.0-rc6 -next-20150130
> 
> diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
> index 8ec353c..5b72d17 100644
> --- a/drivers/iio/adc/vf610_adc.c
> +++ b/drivers/iio/adc/vf610_adc.c
> @@ -259,7 +259,6 @@ static void vf610_adc_cfg_post_set(struct vf610_adc *info)
>  static void vf610_adc_calibration(struct vf610_adc *info)
>  {
>  	int adc_gc, hc_cfg;
> -	int timeout;
>  
>  	if (!info->adc_feature.calibration)
>  		return;
> @@ -271,9 +270,7 @@ static void vf610_adc_calibration(struct vf610_adc *info)
>  	adc_gc = readl(info->regs + VF610_REG_ADC_GC);
>  	writel(adc_gc | VF610_ADC_CAL, info->regs + VF610_REG_ADC_GC);
>  
> -	timeout = wait_for_completion_timeout
> -			(&info->completion, VF610_ADC_TIMEOUT);
> -	if (timeout == 0)
> +	if (!wait_for_completion_timeout(&info->completion, VF610_ADC_TIMEOUT))
>  		dev_err(info->dev, "Timeout for adc calibration\n");
>  
>  	adc_gc = readl(info->regs + VF610_REG_ADC_GS);
> 


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

* Re: [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling
  2015-02-02  8:35 [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling Nicholas Mc Guire
  2015-02-04 17:01 ` Jonathan Cameron
@ 2015-02-06  6:05 ` sanjeev sharma
  1 sibling, 0 replies; 3+ messages in thread
From: sanjeev sharma @ 2015-02-06  6:05 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald, Fabio Estevam, Fugang Duan, Sanjeev Sharma,
	Sanchayan Maity, linux-iio, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1956 bytes --]

On Mon, Feb 2, 2015 at 2:05 PM, Nicholas Mc Guire <hofrat@osadl.org> wrote:

> return type of wait_for_completion_timeout is unsigned long not int, this
> patch only fixes up the return handling.
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
>
Reviewed-by: Sanjeev Sharma <sanjeev_sharma@mentor.com>

> ---
>  drivers/iio/adc/vf610_adc.c |    5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> Rather than changing timeout to unsigned long it can be moved into the
> if condition and dropped.
>
> Patch was compile tested only for imx_v6_v7_defconfig + CONFIG_IIO=m,
> CONFIG_VF610_ADC=m
>
> Patch is against 3.19.0-rc6 -next-20150130
>
> diff --git a/drivers/iio/adc/vf610_adc.c b/drivers/iio/adc/vf610_adc.c
> index 8ec353c..5b72d17 100644
> --- a/drivers/iio/adc/vf610_adc.c
> +++ b/drivers/iio/adc/vf610_adc.c
> @@ -259,7 +259,6 @@ static void vf610_adc_cfg_post_set(struct vf610_adc
> *info)
>  static void vf610_adc_calibration(struct vf610_adc *info)
>  {
>         int adc_gc, hc_cfg;
> -       int timeout;
>
>         if (!info->adc_feature.calibration)
>                 return;
> @@ -271,9 +270,7 @@ static void vf610_adc_calibration(struct vf610_adc
> *info)
>         adc_gc = readl(info->regs + VF610_REG_ADC_GC);
>         writel(adc_gc | VF610_ADC_CAL, info->regs + VF610_REG_ADC_GC);
>
> -       timeout = wait_for_completion_timeout
> -                       (&info->completion, VF610_ADC_TIMEOUT);
> -       if (timeout == 0)
> +       if (!wait_for_completion_timeout(&info->completion,
> VF610_ADC_TIMEOUT))
>                 dev_err(info->dev, "Timeout for adc calibration\n");
>
>         adc_gc = readl(info->regs + VF610_REG_ADC_GS);
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

[-- Attachment #2: Type: text/html, Size: 2996 bytes --]

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

end of thread, other threads:[~2015-02-06  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-02  8:35 [PATCH 1/3] iio: vf610_adc: cleanup wait_for_completion return handling Nicholas Mc Guire
2015-02-04 17:01 ` Jonathan Cameron
2015-02-06  6:05 ` sanjeev sharma

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.