diff mbox series

drm/msm/mdp4: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare

Message ID 20201231094155.25481-1-vulab@iscas.ac.cn (mailing list archive)
State New, archived
Headers show
Series drm/msm/mdp4: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare | expand

Commit Message

Xu Wang Dec. 31, 2020, 9:41 a.m. UTC
Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.

Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
 drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

Comments

Dmitry Baryshkov Oct. 2, 2021, 7:48 p.m. UTC | #1
On 31/12/2020 12:41, Xu Wang wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
>   drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c | 18 ++++++------------
>   1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> index 3d729270bde1..696a22d571ad 100644
> --- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> +++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
> @@ -207,12 +207,9 @@ int mdp4_disable(struct mdp4_kms *mdp4_kms)
>   	DBG("");
>   
>   	clk_disable_unprepare(mdp4_kms->clk);
> -	if (mdp4_kms->pclk)
> -		clk_disable_unprepare(mdp4_kms->pclk);
> -	if (mdp4_kms->lut_clk)
> -		clk_disable_unprepare(mdp4_kms->lut_clk);
> -	if (mdp4_kms->axi_clk)
> -		clk_disable_unprepare(mdp4_kms->axi_clk);
> +	clk_disable_unprepare(mdp4_kms->pclk);
> +	clk_disable_unprepare(mdp4_kms->lut_clk);
> +	clk_disable_unprepare(mdp4_kms->axi_clk);
>   
>   	return 0;
>   }
> @@ -222,12 +219,9 @@ int mdp4_enable(struct mdp4_kms *mdp4_kms)
>   	DBG("");
>   
>   	clk_prepare_enable(mdp4_kms->clk);
> -	if (mdp4_kms->pclk)
> -		clk_prepare_enable(mdp4_kms->pclk);
> -	if (mdp4_kms->lut_clk)
> -		clk_prepare_enable(mdp4_kms->lut_clk);
> -	if (mdp4_kms->axi_clk)
> -		clk_prepare_enable(mdp4_kms->axi_clk);
> +	clk_prepare_enable(mdp4_kms->pclk);
> +	clk_prepare_enable(mdp4_kms->lut_clk);
> +	clk_prepare_enable(mdp4_kms->axi_clk);
>   
>   	return 0;
>   }
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
index 3d729270bde1..696a22d571ad 100644
--- a/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
+++ b/drivers/gpu/drm/msm/disp/mdp4/mdp4_kms.c
@@ -207,12 +207,9 @@  int mdp4_disable(struct mdp4_kms *mdp4_kms)
 	DBG("");
 
 	clk_disable_unprepare(mdp4_kms->clk);
-	if (mdp4_kms->pclk)
-		clk_disable_unprepare(mdp4_kms->pclk);
-	if (mdp4_kms->lut_clk)
-		clk_disable_unprepare(mdp4_kms->lut_clk);
-	if (mdp4_kms->axi_clk)
-		clk_disable_unprepare(mdp4_kms->axi_clk);
+	clk_disable_unprepare(mdp4_kms->pclk);
+	clk_disable_unprepare(mdp4_kms->lut_clk);
+	clk_disable_unprepare(mdp4_kms->axi_clk);
 
 	return 0;
 }
@@ -222,12 +219,9 @@  int mdp4_enable(struct mdp4_kms *mdp4_kms)
 	DBG("");
 
 	clk_prepare_enable(mdp4_kms->clk);
-	if (mdp4_kms->pclk)
-		clk_prepare_enable(mdp4_kms->pclk);
-	if (mdp4_kms->lut_clk)
-		clk_prepare_enable(mdp4_kms->lut_clk);
-	if (mdp4_kms->axi_clk)
-		clk_prepare_enable(mdp4_kms->axi_clk);
+	clk_prepare_enable(mdp4_kms->pclk);
+	clk_prepare_enable(mdp4_kms->lut_clk);
+	clk_prepare_enable(mdp4_kms->axi_clk);
 
 	return 0;
 }