OMAPDSS: move display sysfs init to compat layer
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 8 Nov 2012 12:11:29 +0000 (14:11 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 7 Dec 2012 15:05:58 +0000 (17:05 +0200)
Move creation of the sysfs files for displays to the compat layer.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/apply.c
drivers/video/omap2/dss/core.c
drivers/video/omap2/dss/display.c
drivers/video/omap2/dss/dss.h

index 29e11434b7df8c7b4f7fd43afc8894de00c1e61b..d446bdfc4c821fc4a26caf401716cc843cef370a 100644 (file)
@@ -1562,6 +1562,7 @@ static DEFINE_MUTEX(compat_init_lock);
 int omapdss_compat_init(void)
 {
        struct platform_device *pdev = dss_get_core_pdev();
+       struct omap_dss_device *dssdev = NULL;
        int i, r;
 
        mutex_lock(&compat_init_lock);
@@ -1607,6 +1608,13 @@ int omapdss_compat_init(void)
        if (r)
                goto err_mgr_ops;
 
+       for_each_dss_dev(dssdev) {
+               r = display_init_sysfs(pdev, dssdev);
+               /* XXX uninit sysfs files on error */
+               if (r)
+                       goto err_disp_sysfs;
+       }
+
        dispc_runtime_get();
 
        r = dss_dispc_initialize_irq();
@@ -1622,6 +1630,8 @@ out:
 
 err_init_irq:
        dispc_runtime_put();
+
+err_disp_sysfs:
        dss_uninstall_mgr_ops();
 
 err_mgr_ops:
@@ -1639,6 +1649,7 @@ EXPORT_SYMBOL(omapdss_compat_init);
 void omapdss_compat_uninit(void)
 {
        struct platform_device *pdev = dss_get_core_pdev();
+       struct omap_dss_device *dssdev = NULL;
 
        mutex_lock(&compat_init_lock);
 
@@ -1647,6 +1658,9 @@ void omapdss_compat_uninit(void)
 
        dss_dispc_uninitialize_irq();
 
+       for_each_dss_dev(dssdev)
+               display_uninit_sysfs(pdev, dssdev);
+
        dss_uninstall_mgr_ops();
 
        dss_uninit_overlay_managers(pdev);
index 1751c1f511ad90fa3afeeea7811f41687dec0874..50817fe18cf7766741a932cf4e3dee58a1043e72 100644 (file)
@@ -347,15 +347,10 @@ static int dss_driver_probe(struct device *dev)
                                dev_name(dev), dssdev->driver_name,
                                dssdrv->driver.name);
 
-       r = dss_init_device(core.pdev, dssdev);
-       if (r)
-               return r;
-
        r = dssdrv->probe(dssdev);
 
        if (r) {
                DSSERR("driver probe failed: %d\n", r);
-               dss_uninit_device(core.pdev, dssdev);
                return r;
        }
 
@@ -376,8 +371,6 @@ static int dss_driver_remove(struct device *dev)
 
        dssdrv->remove(dssdev);
 
-       dss_uninit_device(core.pdev, dssdev);
-
        dssdev->driver = NULL;
 
        return 0;
index 05f21b6231b74ffa2286442f8bf1e6a817508e08..0aa8ad8f96679db07b11c6221f7a3eff9f150ffe 100644 (file)
@@ -76,26 +76,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev,
 }
 EXPORT_SYMBOL(omapdss_default_get_timings);
 
-int dss_init_device(struct platform_device *pdev,
-               struct omap_dss_device *dssdev)
-{
-       int r;
-
-       r = display_init_sysfs(pdev, dssdev);
-       if (r) {
-               omapdss_output_unset_device(dssdev->output);
-               return r;
-       }
-
-       return 0;
-}
-
-void dss_uninit_device(struct platform_device *pdev,
-               struct omap_dss_device *dssdev)
-{
-       display_uninit_sysfs(pdev, dssdev);
-}
-
 static int dss_suspend_device(struct device *dev, void *data)
 {
        struct omap_dss_device *dssdev = to_dss_device(dev);
index 180b381fd120d07bf666f2a7eb9ecc5fb6106848..8c89cdda96dd9fdb4718e268a9fafb85dc88dbd5 100644 (file)
@@ -201,11 +201,6 @@ int dss_suspend_all_devices(void);
 int dss_resume_all_devices(void);
 void dss_disable_all_devices(void);
 
-int dss_init_device(struct platform_device *pdev,
-               struct omap_dss_device *dssdev);
-void dss_uninit_device(struct platform_device *pdev,
-               struct omap_dss_device *dssdev);
-
 int display_init_sysfs(struct platform_device *pdev,
                struct omap_dss_device *dssdev);
 void display_uninit_sysfs(struct platform_device *pdev,