OSDN Git Service

drm/msm: Remove redundant null check
authorTian Tao <tiantao6@hisilicon.com>
Mon, 19 Oct 2020 06:04:22 +0000 (14:04 +0800)
committerRob Clark <robdclark@chromium.org>
Wed, 4 Nov 2020 16:26:26 +0000 (08:26 -0800)
clk_prepare_enable() and clk_disable_unprepare() will check
NULL clock parameter, so It is not necessary to add additional checks.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
drivers/gpu/drm/msm/msm_gpu.c

index 3f192a9..4426f50 100644 (file)
@@ -177,15 +177,12 @@ static int disable_clk(struct msm_gpu *gpu)
 
 static int enable_axi(struct msm_gpu *gpu)
 {
-       if (gpu->ebi1_clk)
-               clk_prepare_enable(gpu->ebi1_clk);
-       return 0;
+       return clk_prepare_enable(gpu->ebi1_clk);
 }
 
 static int disable_axi(struct msm_gpu *gpu)
 {
-       if (gpu->ebi1_clk)
-               clk_disable_unprepare(gpu->ebi1_clk);
+       clk_disable_unprepare(gpu->ebi1_clk);
        return 0;
 }