linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe()
@ 2013-10-12  6:46 Wei Yongjun
  2013-10-12  9:56 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Yongjun @ 2013-10-12  6:46 UTC (permalink / raw)
  To: jic23, lars, michael.hennerich, gregkh, sachin.kamat
  Cc: yongjun_wei, linux-iio

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Add the missing clk_disable_unprepare() before return
from adf4350_probe() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/iio/frequency/adf4350.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index a7b30be..52605c0 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -525,8 +525,10 @@ static int adf4350_probe(struct spi_device *spi)
 	}
 
 	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
-	if (indio_dev == NULL)
-		return -ENOMEM;
+	if (indio_dev == NULL) {
+		ret =  -ENOMEM;
+		goto error_disable_clk;
+	}
 
 	st = iio_priv(indio_dev);
 


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

* Re: [PATCH] iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe()
  2013-10-12  6:46 [PATCH] iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe() Wei Yongjun
@ 2013-10-12  9:56 ` Lars-Peter Clausen
  2013-10-12 12:21   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2013-10-12  9:56 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: jic23, michael.hennerich, gregkh, sachin.kamat, yongjun_wei,
	linux-iio

On 10/12/2013 08:46 AM, Wei Yongjun wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Add the missing clk_disable_unprepare() before return
> from adf4350_probe() in the error handling case.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Reviewed-by: Lars-Peter CLausen <lars@metafoo.de>

Thanks.

> ---
>  drivers/iio/frequency/adf4350.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
> index a7b30be..52605c0 100644
> --- a/drivers/iio/frequency/adf4350.c
> +++ b/drivers/iio/frequency/adf4350.c
> @@ -525,8 +525,10 @@ static int adf4350_probe(struct spi_device *spi)
>  	}
>  
>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
> -	if (indio_dev == NULL)
> -		return -ENOMEM;
> +	if (indio_dev == NULL) {
> +		ret =  -ENOMEM;

Here is a extra space. Jonathan can you clean this up when applying the
patch? Thanks.

> +		goto error_disable_clk;
> +	}
>  
>  	st = iio_priv(indio_dev);
>  
> 


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

* Re: [PATCH] iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe()
  2013-10-12  9:56 ` Lars-Peter Clausen
@ 2013-10-12 12:21   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2013-10-12 12:21 UTC (permalink / raw)
  To: Lars-Peter Clausen, Wei Yongjun
  Cc: jic23, michael.hennerich, gregkh, sachin.kamat, yongjun_wei,
	linux-iio

On 10/12/13 10:56, Lars-Peter Clausen wrote:
> On 10/12/2013 08:46 AM, Wei Yongjun wrote:
>> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>>
>> Add the missing clk_disable_unprepare() before return
>> from adf4350_probe() in the error handling case.
>>
>> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> Reviewed-by: Lars-Peter CLausen <lars@metafoo.de>
Applied to the fixes-togreg branch of iio.git

Thanks,

Jonathan
> 
> Thanks.
> 
>> ---
>>  drivers/iio/frequency/adf4350.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
>> index a7b30be..52605c0 100644
>> --- a/drivers/iio/frequency/adf4350.c
>> +++ b/drivers/iio/frequency/adf4350.c
>> @@ -525,8 +525,10 @@ static int adf4350_probe(struct spi_device *spi)
>>  	}
>>  
>>  	indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st));
>> -	if (indio_dev == NULL)
>> -		return -ENOMEM;
>> +	if (indio_dev == NULL) {
>> +		ret =  -ENOMEM;
> 
> Here is a extra space. Jonathan can you clean this up when applying the
> patch? Thanks.
> 
>> +		goto error_disable_clk;
>> +	}
>>  
>>  	st = iio_priv(indio_dev);
>>  
>>
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

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

end of thread, other threads:[~2013-10-12 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-12  6:46 [PATCH] iio: frequency: adf4350: add missing clk_disable_unprepare() on error in adf4350_probe() Wei Yongjun
2013-10-12  9:56 ` Lars-Peter Clausen
2013-10-12 12:21   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).