diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-10 10:26:45 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-12-07 17:06:00 +0200 |
commit | a9ee9f08b615f746f31a41a6415712081c1a2865 (patch) | |
tree | df88c096edcff99241371e5338439fd3faef59aa | |
parent | 348be69d306260c9bcb62662c4cf04196a2b9f53 (diff) | |
download | linux-stable-a9ee9f08b615f746f31a41a6415712081c1a2865.tar.gz linux-stable-a9ee9f08b615f746f31a41a6415712081c1a2865.tar.bz2 linux-stable-a9ee9f08b615f746f31a41a6415712081c1a2865.zip |
OMAPDSS: use omapdss_compat_init() in other drivers
omapdss_compat_init() and omapdss_compat_uninit() is called internally
by omapdss. This patch moves the calls to omapfb, omap_vout and omapdrm
drivers. omapdrm driver can later remove the call after non-compat
support has been implemented in omapdrm.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r-- | drivers/media/platform/omap/omap_vout.c | 17 | ||||
-rw-r--r-- | drivers/staging/omapdrm/omap_drv.c | 11 | ||||
-rw-r--r-- | drivers/video/omap2/dss/core.c | 4 | ||||
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 6 |
4 files changed, 31 insertions, 7 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index a2cc634eb42e..e8cac9e55bc9 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c @@ -2184,14 +2184,23 @@ static int __init omap_vout_probe(struct platform_device *pdev) struct omap_dss_device *def_display; struct omap2video_device *vid_dev = NULL; + ret = omapdss_compat_init(); + if (ret) { + dev_err(&pdev->dev, "failed to init dss\n"); + return ret; + } + if (pdev->num_resources == 0) { dev_err(&pdev->dev, "probed for an unknown device\n"); - return -ENODEV; + ret = -ENODEV; + goto err_dss_init; } vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL); - if (vid_dev == NULL) - return -ENOMEM; + if (vid_dev == NULL) { + ret = -ENOMEM; + goto err_dss_init; + } vid_dev->num_displays = 0; for_each_dss_dev(dssdev) { @@ -2286,6 +2295,8 @@ probe_err1: } probe_err0: kfree(vid_dev); +err_dss_init: + omapdss_compat_uninit(); return ret; } diff --git a/drivers/staging/omapdrm/omap_drv.c b/drivers/staging/omapdrm/omap_drv.c index ebdb0b676737..2bf72591817a 100644 --- a/drivers/staging/omapdrm/omap_drv.c +++ b/drivers/staging/omapdrm/omap_drv.c @@ -572,6 +572,14 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev->dev_private = priv; + ret = omapdss_compat_init(); + if (ret) { + dev_err(dev->dev, "coult not init omapdss\n"); + dev->dev_private = NULL; + kfree(priv); + return ret; + } + priv->wq = alloc_ordered_workqueue("omapdrm", 0); INIT_LIST_HEAD(&priv->obj_list); @@ -583,6 +591,7 @@ static int dev_load(struct drm_device *dev, unsigned long flags) dev_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret); dev->dev_private = NULL; kfree(priv); + omapdss_compat_uninit(); return ret; } @@ -618,6 +627,8 @@ static int dev_unload(struct drm_device *dev) flush_workqueue(priv->wq); destroy_workqueue(priv->wq); + omapdss_compat_uninit(); + kfree(dev->dev_private); dev->dev_private = NULL; diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 50817fe18cf7..f8779d4750ba 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -232,8 +232,6 @@ static int __init omap_dss_probe(struct platform_device *pdev) dss_features_init(omapdss_get_version()); - omapdss_compat_init(); - r = dss_initialize_debugfs(); if (r) goto err_debugfs; @@ -258,8 +256,6 @@ static int omap_dss_remove(struct platform_device *pdev) dss_uninitialize_debugfs(); - omapdss_compat_uninit(); - return 0; } diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index 1f60741a7886..4fa9487a8720 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -2425,6 +2425,9 @@ static int __init omapfb_probe(struct platform_device *pdev) "ignoring the module parameter vrfb=y\n"); } + r = omapdss_compat_init(); + if (r) + goto err0; mutex_init(&fbdev->mtx); @@ -2544,6 +2547,7 @@ static int __init omapfb_probe(struct platform_device *pdev) cleanup: omapfb_free_resources(fbdev); + omapdss_compat_uninit(); err0: dev_err(&pdev->dev, "failed to setup omapfb\n"); return r; @@ -2559,6 +2563,8 @@ static int __exit omapfb_remove(struct platform_device *pdev) omapfb_free_resources(fbdev); + omapdss_compat_uninit(); + return 0; } |