2020-11-27 09:13:57

by Xu Wang

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

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

Signed-off-by: Xu Wang <[email protected]>
---
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