[PATCH] drm/armada: Remove redundant null check before clk_disable_unprepare

Xu Wang vulab at iscas.ac.cn
Fri Nov 27 09:10:56 UTC 2020


Because clk_disable_unprepare() already checked NULL clock parameter,
so the additional check is unnecessary, just remove it.

Signed-off-by: Xu Wang <vulab at iscas.ac.cn>
---
 drivers/gpu/drm/armada/armada_510.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_510.c b/drivers/gpu/drm/armada/armada_510.c
index 93d5c0a2d49a..05fe97900b13 100644
--- a/drivers/gpu/drm/armada/armada_510.c
+++ b/drivers/gpu/drm/armada/armada_510.c
@@ -132,10 +132,8 @@ static int armada510_crtc_compute_clock(struct armada_crtc *dcrtc,
 
 static void armada510_crtc_disable(struct armada_crtc *dcrtc)
 {
-	if (dcrtc->clk) {
-		clk_disable_unprepare(dcrtc->clk);
-		dcrtc->clk = NULL;
-	}
+	clk_disable_unprepare(dcrtc->clk);
+	dcrtc->clk = NULL;
 }
 
 static void armada510_crtc_enable(struct armada_crtc *dcrtc,
-- 
2.17.1



More information about the dri-devel mailing list