summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorGaurav Batra <gbatra@nvidia.com>2012-08-01 12:28:51 -0700
committerSimone Willett <swillett@nvidia.com>2012-08-02 18:12:54 -0700
commit7f72709c2f23c05f65ff4ca8bfecde0db1448a65 (patch)
treeb5f574e1cd312cbb702ab29db86b3acd8fd20f22 /drivers/video
parent31574b0134cfc3b05ba4107ba359d06e6839412a (diff)
video: tegra: hdmi: cleanup error handling in init
In case tegra_dc_init fails, this change will prevent unbalanced call to dc->out_ops->disable(). Also mark tegra_dc_io_end in case tegra_dc_controller_enable fails, this is required to not stop device from going into suspend mode. Bug 1003874 Change-Id: I5af6b46fc50e1ae8e54f9f4eb8540d751364fed7 Signed-off-by: Gaurav Batra <gbatra@nvidia.com> Reviewed-on: http://git-master/r/120108 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/tegra/dc/dc.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index a856691653b1..db97ed3d3c13 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -1299,14 +1299,18 @@ static bool _tegra_dc_controller_enable(struct tegra_dc *dc)
tegra_dc_clk_enable(dc);
/* do not accept interrupts during initialization */
- tegra_dc_writel(dc, 0, DC_CMD_INT_ENABLE);
tegra_dc_writel(dc, 0, DC_CMD_INT_MASK);
enable_dc_irq(dc->irq);
failed_init = tegra_dc_init(dc);
if (failed_init) {
- _tegra_dc_controller_disable(dc);
+ tegra_dc_writel(dc, 0, DC_CMD_INT_MASK);
+ disable_irq(dc->irq);
+ tegra_dc_clear_bandwidth(dc);
+ tegra_dc_clk_disable(dc);
+ if (dc->out && dc->out->disable)
+ dc->out->disable();
return false;
}
@@ -1427,7 +1431,11 @@ static bool _tegra_dc_enable(struct tegra_dc *dc)
tegra_dc_io_start(dc);
- return _tegra_dc_controller_enable(dc);
+ if (!_tegra_dc_controller_enable(dc)) {
+ tegra_dc_io_end(dc);
+ return false;
+ }
+ return true;
}
void tegra_dc_enable(struct tegra_dc *dc)