All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock
@ 2016-07-15  1:54 Jaehoon Chung
  2016-07-15  2:07 ` Shawn Lin
  0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2016-07-15  1:54 UTC (permalink / raw)
  To: linux-mmc; +Cc: ulf.hansson, shawn.lin, Jaehoon Chung

If ciu/biu clock are NULL, clk_disable_unprepare should be just
returned. In clk_disable_unprepare(), already checked whether clk is
error or NULL.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/dw_mmc.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 2dfdc58..9fab5ed 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -3184,12 +3184,10 @@ err_dmaunmap:
 		host->dma_ops->exit(host);
 
 err_clk_ciu:
-	if (!IS_ERR(host->ciu_clk))
-		clk_disable_unprepare(host->ciu_clk);
+	clk_disable_unprepare(host->ciu_clk);
 
 err_clk_biu:
-	if (!IS_ERR(host->biu_clk))
-		clk_disable_unprepare(host->biu_clk);
+	clk_disable_unprepare(host->biu_clk);
 
 	return ret;
 }
@@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host)
 	if (host->use_dma && host->dma_ops->exit)
 		host->dma_ops->exit(host);
 
-	if (!IS_ERR(host->ciu_clk))
-		clk_disable_unprepare(host->ciu_clk);
-
-	if (!IS_ERR(host->biu_clk))
-		clk_disable_unprepare(host->biu_clk);
+	clk_disable_unprepare(host->ciu_clk);
+	clk_disable_unprepare(host->biu_clk);
 }
 EXPORT_SYMBOL(dw_mci_remove);
 
-- 
1.9.1


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

* Re: [PATCH] mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock
  2016-07-15  1:54 [PATCH] mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock Jaehoon Chung
@ 2016-07-15  2:07 ` Shawn Lin
  2016-07-26  0:50   ` Jaehoon Chung
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Lin @ 2016-07-15  2:07 UTC (permalink / raw)
  To: Jaehoon Chung, linux-mmc; +Cc: shawn.lin, ulf.hansson

在 2016/7/15 9:54, Jaehoon Chung 写道:
> If ciu/biu clock are NULL, clk_disable_unprepare should be just
> returned. In clk_disable_unprepare(), already checked whether clk is
> error or NULL.
>
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>

That's a good catch.

Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

> ---
>  drivers/mmc/host/dw_mmc.c | 13 ++++---------
>  1 file changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 2dfdc58..9fab5ed 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -3184,12 +3184,10 @@ err_dmaunmap:
>  		host->dma_ops->exit(host);
>
>  err_clk_ciu:
> -	if (!IS_ERR(host->ciu_clk))
> -		clk_disable_unprepare(host->ciu_clk);
> +	clk_disable_unprepare(host->ciu_clk);
>
>  err_clk_biu:
> -	if (!IS_ERR(host->biu_clk))
> -		clk_disable_unprepare(host->biu_clk);
> +	clk_disable_unprepare(host->biu_clk);
>
>  	return ret;
>  }
> @@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host)
>  	if (host->use_dma && host->dma_ops->exit)
>  		host->dma_ops->exit(host);
>
> -	if (!IS_ERR(host->ciu_clk))
> -		clk_disable_unprepare(host->ciu_clk);
> -
> -	if (!IS_ERR(host->biu_clk))
> -		clk_disable_unprepare(host->biu_clk);
> +	clk_disable_unprepare(host->ciu_clk);
> +	clk_disable_unprepare(host->biu_clk);
>  }
>  EXPORT_SYMBOL(dw_mci_remove);
>
>


-- 
Best Regards
Shawn Lin


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

* Re: [PATCH] mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock
  2016-07-15  2:07 ` Shawn Lin
@ 2016-07-26  0:50   ` Jaehoon Chung
  0 siblings, 0 replies; 3+ messages in thread
From: Jaehoon Chung @ 2016-07-26  0:50 UTC (permalink / raw)
  To: Shawn Lin, linux-mmc; +Cc: ulf.hansson

On 07/15/2016 11:07 AM, Shawn Lin wrote:
> 在 2016/7/15 9:54, Jaehoon Chung 写道:
>> If ciu/biu clock are NULL, clk_disable_unprepare should be just
>> returned. In clk_disable_unprepare(), already checked whether clk is
>> error or NULL.
>>
>> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> 
> That's a good catch.
> 
> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>

Applied on my repository. Thanks!

Best Regards,
Jaehoon Chung

> 
>> ---
>>  drivers/mmc/host/dw_mmc.c | 13 ++++---------
>>  1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
>> index 2dfdc58..9fab5ed 100644
>> --- a/drivers/mmc/host/dw_mmc.c
>> +++ b/drivers/mmc/host/dw_mmc.c
>> @@ -3184,12 +3184,10 @@ err_dmaunmap:
>>          host->dma_ops->exit(host);
>>
>>  err_clk_ciu:
>> -    if (!IS_ERR(host->ciu_clk))
>> -        clk_disable_unprepare(host->ciu_clk);
>> +    clk_disable_unprepare(host->ciu_clk);
>>
>>  err_clk_biu:
>> -    if (!IS_ERR(host->biu_clk))
>> -        clk_disable_unprepare(host->biu_clk);
>> +    clk_disable_unprepare(host->biu_clk);
>>
>>      return ret;
>>  }
>> @@ -3215,11 +3213,8 @@ void dw_mci_remove(struct dw_mci *host)
>>      if (host->use_dma && host->dma_ops->exit)
>>          host->dma_ops->exit(host);
>>
>> -    if (!IS_ERR(host->ciu_clk))
>> -        clk_disable_unprepare(host->ciu_clk);
>> -
>> -    if (!IS_ERR(host->biu_clk))
>> -        clk_disable_unprepare(host->biu_clk);
>> +    clk_disable_unprepare(host->ciu_clk);
>> +    clk_disable_unprepare(host->biu_clk);
>>  }
>>  EXPORT_SYMBOL(dw_mci_remove);
>>
>>
> 
> 


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

end of thread, other threads:[~2016-07-26  0:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-15  1:54 [PATCH] mmc: dw_mmc: remove the unnecessary IS_ERR() checking for ciu/biu clock Jaehoon Chung
2016-07-15  2:07 ` Shawn Lin
2016-07-26  0:50   ` Jaehoon Chung

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.