diff options
author | Ricardo Neri <ricardo.neri@ti.com> | 2012-11-06 01:19:14 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-11-06 06:33:35 -0500 |
commit | 66a06b0c5997fd45eb22c18e8343a3d3865fd5a1 (patch) | |
tree | 93ac59837f78da7dcfe78a3b56f55153e2864093 | |
parent | 7888839e258ee114ca2faabbf741c5001ff668ad (diff) |
OMAPDSS: HDMI: Handle panel init error at probe
Do not blindly assume that the panel could be initialized.
While there, group mutex initialization at a single place.
Signed-off-by: Ricardo Neri <ricardo.neri@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 1d04bc0479e7..31cedbb9f9fd 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c | |||
@@ -60,6 +60,7 @@ | |||
60 | static struct { | 60 | static struct { |
61 | struct mutex lock; | 61 | struct mutex lock; |
62 | struct platform_device *pdev; | 62 | struct platform_device *pdev; |
63 | |||
63 | struct hdmi_ip_data ip_data; | 64 | struct hdmi_ip_data ip_data; |
64 | 65 | ||
65 | struct clk *sys_clk; | 66 | struct clk *sys_clk; |
@@ -1056,6 +1057,7 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1056 | hdmi.pdev = pdev; | 1057 | hdmi.pdev = pdev; |
1057 | 1058 | ||
1058 | mutex_init(&hdmi.lock); | 1059 | mutex_init(&hdmi.lock); |
1060 | mutex_init(&hdmi.ip_data.lock); | ||
1059 | 1061 | ||
1060 | res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); | 1062 | res = platform_get_resource(hdmi.pdev, IORESOURCE_MEM, 0); |
1061 | if (!res) { | 1063 | if (!res) { |
@@ -1083,9 +1085,11 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1083 | hdmi.ip_data.pll_offset = HDMI_PLLCTRL; | 1085 | hdmi.ip_data.pll_offset = HDMI_PLLCTRL; |
1084 | hdmi.ip_data.phy_offset = HDMI_PHY; | 1086 | hdmi.ip_data.phy_offset = HDMI_PHY; |
1085 | 1087 | ||
1086 | mutex_init(&hdmi.ip_data.lock); | 1088 | r = hdmi_panel_init(); |
1087 | 1089 | if (r) { | |
1088 | hdmi_panel_init(); | 1090 | DSSERR("can't init panel\n"); |
1091 | goto err_panel_init; | ||
1092 | } | ||
1089 | 1093 | ||
1090 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); | 1094 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); |
1091 | 1095 | ||
@@ -1094,6 +1098,10 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev) | |||
1094 | hdmi_probe_pdata(pdev); | 1098 | hdmi_probe_pdata(pdev); |
1095 | 1099 | ||
1096 | return 0; | 1100 | return 0; |
1101 | |||
1102 | err_panel_init: | ||
1103 | hdmi_put_clocks(); | ||
1104 | return r; | ||
1097 | } | 1105 | } |
1098 | 1106 | ||
1099 | static int __exit hdmi_remove_child(struct device *dev, void *data) | 1107 | static int __exit hdmi_remove_child(struct device *dev, void *data) |