diff mbox series

[RFC,10/15] drm: rcar-du: dsi: Add error handling in rcar_mipi_dsi_clk_enable()

Message ID 20210623034656.10316-11-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State New
Delegated to: Kieran Bingham
Headers show
Series R-Car V3U: DSI encoder driver | expand

Commit Message

Laurent Pinchart June 23, 2021, 3:46 a.m. UTC
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
index d16bf50e8acb..2ef82ef0edc5 100644
--- a/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
+++ b/drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c
@@ -618,13 +618,19 @@  int rcar_mipi_dsi_clk_enable(struct drm_bridge *bridge)
 
 	ret = clk_prepare_enable(dsi->clocks.dsi);
 	if (ret < 0)
-		return ret;
+		goto err_clock_mod;
 
 	ret = rcar_mipi_dsi_startup(dsi);
 	if (ret < 0)
-		return ret;
+		goto err_clock_dsi;
 
 	return 0;
+
+err_clock_dsi:
+	clk_disable_unprepare(dsi->clocks.dsi);
+err_clock_mod:
+	clk_disable_unprepare(dsi->clocks.mod);
+	return ret;
 }
 EXPORT_SYMBOL_GPL(rcar_mipi_dsi_clk_enable);
 
@@ -634,9 +640,7 @@  void rcar_mipi_dsi_clk_disable(struct drm_bridge *bridge)
 
 	rcar_mipi_dsi_shutdown(dsi);
 
-	/* Disable DSI clock and reset HW */
 	clk_disable_unprepare(dsi->clocks.dsi);
-
 	clk_disable_unprepare(dsi->clocks.mod);
 
 	reset_control_assert(dsi->rstc);