tegra: video: hdmi: WAR: check hdmi validity
Min-wuk Lee [Thu, 17 Oct 2013 03:07:38 +0000 (12:07 +0900)]
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 <mlee@nvidia.com>
Reviewed-on: http://git-master/r/300307
(cherry picked from commit 19a5b58041e74b825469ebfef2ed9866fad90840)
Reviewed-on: http://git-master/r/302766
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

drivers/video/tegra/dc/hdmi.c

index 35fb3ea..19cba45 100644 (file)
@@ -475,7 +475,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);
@@ -489,7 +494,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);