Skip to contentSkip to conversation

drm/ingenic: remove redundant null check

PATCH New Xu Wang 1 participant 1 message Sep 30, 2020

Subsystems (3)
lore
Share & tools
lore

Xu Wang

author
#0 lore raw

PATCH 1/1 drm/ingenic: remove redundant null check

Because clk_disable_unprepare already checked NULL clock parameter, so the additional checks are unnecessary, just remove them.

---
 drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm-drv.c +2 -4
index b7074161ccf0..9dce02e779ad 100644
@@ -932,8 +932,7 @@ static int ingenic_drm_bind(struct device *dev, bool has_components)
 	return 0;
 
 err_devclk_disable:
-	if (priv->lcd_clk)
-		clk_disable_unprepare(priv->lcd_clk);
+	clk_disable_unprepare(priv->lcd_clk);
 err_pixclk_disable:
 	clk_disable_unprepare(priv->pix_clk);
 	return ret;
@@ -953,8 +952,7 @@ static void ingenic_drm_unbind(struct device *dev)
 {
 	struct ingenic_drm *priv = dev_get_drvdata(dev);
 
-	if (priv->lcd_clk)
-		clk_disable_unprepare(priv->lcd_clk);
+	clk_disable_unprepare(priv->lcd_clk);
 	clk_disable_unprepare(priv->pix_clk);
 
 	drm_dev_unregister(&priv->drm);
Signature · 1 line
2.17.1