diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-03-14 09:47:29 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-06-17 07:00:39 -0400 |
commit | c6ca5b2201289995f70ee19c0eaf4b5f2ae09923 (patch) | |
tree | acf7cce67a9df7ec5bf959bc9af390afc510aa2d | |
parent | 0a20012605033c8acd8b2c209c422d78880e2896 (diff) |
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>
-rw-r--r-- | drivers/video/omap2/dss/dpi.c | 12 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dsi.c | 13 | ||||
-rw-r--r-- | drivers/video/omap2/dss/hdmi.c | 16 | ||||
-rw-r--r-- | drivers/video/omap2/dss/rfbi.c | 11 | ||||
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 12 | ||||
-rw-r--r-- | drivers/video/omap2/dss/venc.c | 13 |
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) | |||
706 | 706 | ||
707 | dpi_init_output(pdev); | 707 | dpi_init_output(pdev); |
708 | 708 | ||
709 | r = dpi_probe_pdata(pdev); | 709 | if (pdev->dev.platform_data) { |
710 | if (r) { | 710 | r = dpi_probe_pdata(pdev); |
711 | dpi_uninit_output(pdev); | 711 | if (r) |
712 | return r; | 712 | goto err_probe; |
713 | } | 713 | } |
714 | 714 | ||
715 | return 0; | 715 | return 0; |
716 | |||
717 | err_probe: | ||
718 | dpi_uninit_output(pdev); | ||
719 | return r; | ||
716 | } | 720 | } |
717 | 721 | ||
718 | static int __exit omap_dpi_remove(struct platform_device *pdev) | 722 | 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) | |||
5563 | 5563 | ||
5564 | dsi_init_output(dsidev); | 5564 | dsi_init_output(dsidev); |
5565 | 5565 | ||
5566 | r = dsi_probe_pdata(dsidev); | 5566 | if (dsidev->dev.platform_data) { |
5567 | if (r) { | 5567 | r = dsi_probe_pdata(dsidev); |
5568 | dsi_runtime_put(dsidev); | 5568 | if (r) |
5569 | dsi_uninit_output(dsidev); | 5569 | goto err_probe; |
5570 | pm_runtime_disable(&dsidev->dev); | ||
5571 | return r; | ||
5572 | } | 5570 | } |
5573 | 5571 | ||
5574 | dsi_runtime_put(dsidev); | 5572 | dsi_runtime_put(dsidev); |
@@ -5586,6 +5584,9 @@ static int omap_dsihw_probe(struct platform_device *dsidev) | |||
5586 | #endif | 5584 | #endif |
5587 | return 0; | 5585 | return 0; |
5588 | 5586 | ||
5587 | err_probe: | ||
5588 | dsi_runtime_put(dsidev); | ||
5589 | dsi_uninit_output(dsidev); | ||
5589 | err_runtime_get: | 5590 | err_runtime_get: |
5590 | pm_runtime_disable(&dsidev->dev); | 5591 | pm_runtime_disable(&dsidev->dev); |
5591 | return r; | 5592 | 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) | |||
1094 | 1094 | ||
1095 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); | 1095 | dss_debugfs_create_file("hdmi", hdmi_dump_regs); |
1096 | 1096 | ||
1097 | r = hdmi_probe_pdata(pdev); | 1097 | if (pdev->dev.platform_data) { |
1098 | if (r) { | 1098 | r = hdmi_probe_pdata(pdev); |
1099 | hdmi_panel_exit(); | 1099 | if (r) |
1100 | hdmi_uninit_output(pdev); | 1100 | goto err_probe; |
1101 | pm_runtime_disable(&pdev->dev); | ||
1102 | return r; | ||
1103 | } | 1101 | } |
1104 | 1102 | ||
1105 | return 0; | 1103 | return 0; |
1104 | |||
1105 | err_probe: | ||
1106 | hdmi_panel_exit(); | ||
1107 | hdmi_uninit_output(pdev); | ||
1108 | pm_runtime_disable(&pdev->dev); | ||
1109 | return r; | ||
1106 | } | 1110 | } |
1107 | 1111 | ||
1108 | static int __exit hdmi_remove_child(struct device *dev, void *data) | 1112 | 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) | |||
1093 | 1093 | ||
1094 | rfbi_init_output(pdev); | 1094 | rfbi_init_output(pdev); |
1095 | 1095 | ||
1096 | r = rfbi_probe_pdata(pdev); | 1096 | if (pdev->dev.platform_data) { |
1097 | if (r) { | 1097 | r = rfbi_probe_pdata(pdev); |
1098 | rfbi_uninit_output(pdev); | 1098 | if (r) |
1099 | pm_runtime_disable(&pdev->dev); | 1099 | goto err_probe; |
1100 | return r; | ||
1101 | } | 1100 | } |
1102 | 1101 | ||
1103 | return 0; | 1102 | return 0; |
1104 | 1103 | ||
1104 | err_probe: | ||
1105 | rfbi_uninit_output(pdev); | ||
1105 | err_runtime_get: | 1106 | err_runtime_get: |
1106 | pm_runtime_disable(&pdev->dev); | 1107 | pm_runtime_disable(&pdev->dev); |
1107 | return r; | 1108 | 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) | |||
365 | 365 | ||
366 | sdi_init_output(pdev); | 366 | sdi_init_output(pdev); |
367 | 367 | ||
368 | r = sdi_probe_pdata(pdev); | 368 | if (pdev->dev.platform_data) { |
369 | if (r) { | 369 | r = sdi_probe_pdata(pdev); |
370 | sdi_uninit_output(pdev); | 370 | if (r) |
371 | return r; | 371 | goto err_probe; |
372 | } | 372 | } |
373 | 373 | ||
374 | return 0; | 374 | return 0; |
375 | |||
376 | err_probe: | ||
377 | sdi_uninit_output(pdev); | ||
378 | return r; | ||
375 | } | 379 | } |
376 | 380 | ||
377 | static int __exit omap_sdi_remove(struct platform_device *pdev) | 381 | 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) | |||
866 | 866 | ||
867 | venc_init_output(pdev); | 867 | venc_init_output(pdev); |
868 | 868 | ||
869 | r = venc_probe_pdata(pdev); | 869 | if (pdev->dev.platform_data) { |
870 | if (r) { | 870 | r = venc_probe_pdata(pdev); |
871 | venc_panel_exit(); | 871 | if (r) |
872 | venc_uninit_output(pdev); | 872 | goto err_probe; |
873 | pm_runtime_disable(&pdev->dev); | ||
874 | return r; | ||
875 | } | 873 | } |
876 | 874 | ||
877 | return 0; | 875 | return 0; |
878 | 876 | ||
877 | err_probe: | ||
878 | venc_panel_exit(); | ||
879 | venc_uninit_output(pdev); | ||
879 | err_panel_init: | 880 | err_panel_init: |
880 | err_runtime_get: | 881 | err_runtime_get: |
881 | pm_runtime_disable(&pdev->dev); | 882 | pm_runtime_disable(&pdev->dev); |