OMAPDSS: only probe pdata if there's one
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 14 Mar 2013 13:47:29 +0000 (15:47 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 17 Jun 2013 11:00:39 +0000 (14:00 +0300)
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>
drivers/video/omap2/dss/dpi.c
drivers/video/omap2/dss/dsi.c
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/rfbi.c
drivers/video/omap2/dss/sdi.c
drivers/video/omap2/dss/venc.c

index 757b57f7275a815a535732dc0727206b3d336ccd..ef8fca211abe7f5b4242abe548e5e1a426f743a5 100644 (file)
@@ -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)
index a73dedc33101bb91a3da35b2481252a04f87ae33..bdddd0d177b617e877a0821cb23a67f3b8a1599a 100644 (file)
@@ -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;
index a109934c0478ea72808eb0205018d0a1253341f0..fe72746411e1f53c33bda25b34ff58b23ab9b78a 100644 (file)
@@ -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)
index 1a17dd1447dc29505cc4c86870646cfd24a91b2e..1ff221edc359c018a2f069ae30ab8f174acd0b64 100644 (file)
@@ -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;
index 0bcd30272f69a29b4bd743bd787fcc5e48e8fcf4..6277c059385470664713c301c238a58b39b14cbc 100644 (file)
@@ -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)
index 74fdb3ee209e48bb3a91af85d84d3498ac6e5d25..7b2e3ae18bd7e1f66a885ad932d7de18d426598f 100644 (file)
@@ -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);