summaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dss
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-03-14 15:47:29 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-06-17 14:00:39 +0300
commitc6ca5b2201289995f70ee19c0eaf4b5f2ae09923 (patch)
treeacf7cce67a9df7ec5bf959bc9af390afc510aa2d /drivers/video/omap2/dss
parent0a20012605033c8acd8b2c209c422d78880e2896 (diff)
downloadblackbird-op-linux-c6ca5b2201289995f70ee19c0eaf4b5f2ae09923.tar.gz
blackbird-op-linux-c6ca5b2201289995f70ee19c0eaf4b5f2ae09923.zip
OMAPDSS: only probe pdata if there's one
omapdss output drivers always read the platform data. This crashes when there's no platform data when using DT. Add a check to read the platform data only if it exists. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss')
-rw-r--r--drivers/video/omap2/dss/dpi.c12
-rw-r--r--drivers/video/omap2/dss/dsi.c13
-rw-r--r--drivers/video/omap2/dss/hdmi.c16
-rw-r--r--drivers/video/omap2/dss/rfbi.c11
-rw-r--r--drivers/video/omap2/dss/sdi.c12
-rw-r--r--drivers/video/omap2/dss/venc.c13
6 files changed, 46 insertions, 31 deletions
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 757b57f7275a..ef8fca211abe 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -706,13 +706,17 @@ static int omap_dpi_probe(struct platform_device *pdev)
dpi_init_output(pdev);
- r = dpi_probe_pdata(pdev);
- if (r) {
- dpi_uninit_output(pdev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = dpi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ dpi_uninit_output(pdev);
+ return r;
}
static int __exit omap_dpi_remove(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index a73dedc33101..bdddd0d177b6 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -5563,12 +5563,10 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
dsi_init_output(dsidev);
- r = dsi_probe_pdata(dsidev);
- if (r) {
- dsi_runtime_put(dsidev);
- dsi_uninit_output(dsidev);
- pm_runtime_disable(&dsidev->dev);
- return r;
+ if (dsidev->dev.platform_data) {
+ r = dsi_probe_pdata(dsidev);
+ if (r)
+ goto err_probe;
}
dsi_runtime_put(dsidev);
@@ -5586,6 +5584,9 @@ static int omap_dsihw_probe(struct platform_device *dsidev)
#endif
return 0;
+err_probe:
+ dsi_runtime_put(dsidev);
+ dsi_uninit_output(dsidev);
err_runtime_get:
pm_runtime_disable(&dsidev->dev);
return r;
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index a109934c0478..fe72746411e1 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -1094,15 +1094,19 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
dss_debugfs_create_file("hdmi", hdmi_dump_regs);
- r = hdmi_probe_pdata(pdev);
- if (r) {
- hdmi_panel_exit();
- hdmi_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = hdmi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ hdmi_panel_exit();
+ hdmi_uninit_output(pdev);
+ pm_runtime_disable(&pdev->dev);
+ return r;
}
static int __exit hdmi_remove_child(struct device *dev, void *data)
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 1a17dd1447dc..1ff221edc359 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -1093,15 +1093,16 @@ static int omap_rfbihw_probe(struct platform_device *pdev)
rfbi_init_output(pdev);
- r = rfbi_probe_pdata(pdev);
- if (r) {
- rfbi_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = rfbi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+err_probe:
+ rfbi_uninit_output(pdev);
err_runtime_get:
pm_runtime_disable(&pdev->dev);
return r;
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 0bcd30272f69..6277c0593854 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -365,13 +365,17 @@ static int omap_sdi_probe(struct platform_device *pdev)
sdi_init_output(pdev);
- r = sdi_probe_pdata(pdev);
- if (r) {
- sdi_uninit_output(pdev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = sdi_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+
+err_probe:
+ sdi_uninit_output(pdev);
+ return r;
}
static int __exit omap_sdi_remove(struct platform_device *pdev)
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 74fdb3ee209e..7b2e3ae18bd7 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -866,16 +866,17 @@ static int omap_venchw_probe(struct platform_device *pdev)
venc_init_output(pdev);
- r = venc_probe_pdata(pdev);
- if (r) {
- venc_panel_exit();
- venc_uninit_output(pdev);
- pm_runtime_disable(&pdev->dev);
- return r;
+ if (pdev->dev.platform_data) {
+ r = venc_probe_pdata(pdev);
+ if (r)
+ goto err_probe;
}
return 0;
+err_probe:
+ venc_panel_exit();
+ venc_uninit_output(pdev);
err_panel_init:
err_runtime_get:
pm_runtime_disable(&pdev->dev);
OpenPOWER on IntegriCloud