From 19a5b58041e74b825469ebfef2ed9866fad90840 Mon Sep 17 00:00:00 2001 From: Min-wuk Lee Date: Thu, 17 Oct 2013 12:07:38 +0900 Subject: tegra: video: hdmi: WAR: check hdmi validity It is possible that hdmi and its display controller are not used depending on hardware requirement. This change is checking hdmi validity and if it isn't valid, do not handle hdmi clk. Bug 1390118 Change-Id: I1ff422c29ee7228095bf057c11e37c479555e5ab Signed-off-by: Min-wuk Lee Reviewed-on: http://git-master/r/300307 Reviewed-by: Youngjin Kim GVS: Gerrit_Virtual_Submit Reviewed-by: Gabby Lee --- drivers/video/tegra/dc/hdmi.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index 0f98cd75acaa..fa879a51ba3b 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -474,7 +474,12 @@ static inline void tegra_hdmi_hotplug_enable(struct tegra_dc_hdmi_data *hdmi) void tegra_hdmi_enable_clk(void) { struct tegra_dc_hdmi_data *hdmi = dc_hdmi; - struct tegra_dc *dc = hdmi->dc; + struct tegra_dc *dc; + + if (!hdmi) + return; + + dc = hdmi->dc; mutex_lock(&dc->lock); clk_prepare_enable(hdmi->disp1_clk); @@ -488,7 +493,12 @@ EXPORT_SYMBOL(tegra_hdmi_enable_clk); void tegra_hdmi_disable_clk(void) { struct tegra_dc_hdmi_data *hdmi = dc_hdmi; - struct tegra_dc *dc = hdmi->dc; + struct tegra_dc *dc; + + if (!hdmi) + return; + + dc = hdmi->dc; atomic_set(&tf_hdmi_enable, 0); mutex_lock(&dc->lock); -- cgit v1.2.3