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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/rcar-du/rcar_mipi_dsi.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

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);
-- 
Regards,

Laurent Pinchart




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux