Commit a9ee9f08 authored by Tomi Valkeinen's avatar Tomi Valkeinen

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: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 348be69d
...@@ -2184,14 +2184,23 @@ static int __init omap_vout_probe(struct platform_device *pdev) ...@@ -2184,14 +2184,23 @@ static int __init omap_vout_probe(struct platform_device *pdev)
struct omap_dss_device *def_display; struct omap_dss_device *def_display;
struct omap2video_device *vid_dev = NULL; 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) { if (pdev->num_resources == 0) {
dev_err(&pdev->dev, "probed for an unknown device\n"); 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); vid_dev = kzalloc(sizeof(struct omap2video_device), GFP_KERNEL);
if (vid_dev == NULL) if (vid_dev == NULL) {
return -ENOMEM; ret = -ENOMEM;
goto err_dss_init;
}
vid_dev->num_displays = 0; vid_dev->num_displays = 0;
for_each_dss_dev(dssdev) { for_each_dss_dev(dssdev) {
...@@ -2286,6 +2295,8 @@ static int __init omap_vout_probe(struct platform_device *pdev) ...@@ -2286,6 +2295,8 @@ static int __init omap_vout_probe(struct platform_device *pdev)
} }
probe_err0: probe_err0:
kfree(vid_dev); kfree(vid_dev);
err_dss_init:
omapdss_compat_uninit();
return ret; return ret;
} }
......
...@@ -572,6 +572,14 @@ static int dev_load(struct drm_device *dev, unsigned long flags) ...@@ -572,6 +572,14 @@ static int dev_load(struct drm_device *dev, unsigned long flags)
dev->dev_private = priv; 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); priv->wq = alloc_ordered_workqueue("omapdrm", 0);
INIT_LIST_HEAD(&priv->obj_list); INIT_LIST_HEAD(&priv->obj_list);
...@@ -583,6 +591,7 @@ static int dev_load(struct drm_device *dev, unsigned long flags) ...@@ -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_err(dev->dev, "omap_modeset_init failed: ret=%d\n", ret);
dev->dev_private = NULL; dev->dev_private = NULL;
kfree(priv); kfree(priv);
omapdss_compat_uninit();
return ret; return ret;
} }
...@@ -618,6 +627,8 @@ static int dev_unload(struct drm_device *dev) ...@@ -618,6 +627,8 @@ static int dev_unload(struct drm_device *dev)
flush_workqueue(priv->wq); flush_workqueue(priv->wq);
destroy_workqueue(priv->wq); destroy_workqueue(priv->wq);
omapdss_compat_uninit();
kfree(dev->dev_private); kfree(dev->dev_private);
dev->dev_private = NULL; dev->dev_private = NULL;
......
...@@ -232,8 +232,6 @@ static int __init omap_dss_probe(struct platform_device *pdev) ...@@ -232,8 +232,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
dss_features_init(omapdss_get_version()); dss_features_init(omapdss_get_version());
omapdss_compat_init();
r = dss_initialize_debugfs(); r = dss_initialize_debugfs();
if (r) if (r)
goto err_debugfs; goto err_debugfs;
...@@ -258,8 +256,6 @@ static int omap_dss_remove(struct platform_device *pdev) ...@@ -258,8 +256,6 @@ static int omap_dss_remove(struct platform_device *pdev)
dss_uninitialize_debugfs(); dss_uninitialize_debugfs();
omapdss_compat_uninit();
return 0; return 0;
} }
......
...@@ -2425,6 +2425,9 @@ static int __init omapfb_probe(struct platform_device *pdev) ...@@ -2425,6 +2425,9 @@ static int __init omapfb_probe(struct platform_device *pdev)
"ignoring the module parameter vrfb=y\n"); "ignoring the module parameter vrfb=y\n");
} }
r = omapdss_compat_init();
if (r)
goto err0;
mutex_init(&fbdev->mtx); mutex_init(&fbdev->mtx);
...@@ -2544,6 +2547,7 @@ static int __init omapfb_probe(struct platform_device *pdev) ...@@ -2544,6 +2547,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
cleanup: cleanup:
omapfb_free_resources(fbdev); omapfb_free_resources(fbdev);
omapdss_compat_uninit();
err0: err0:
dev_err(&pdev->dev, "failed to setup omapfb\n"); dev_err(&pdev->dev, "failed to setup omapfb\n");
return r; return r;
...@@ -2559,6 +2563,8 @@ static int __exit omapfb_remove(struct platform_device *pdev) ...@@ -2559,6 +2563,8 @@ static int __exit omapfb_remove(struct platform_device *pdev)
omapfb_free_resources(fbdev); omapfb_free_resources(fbdev);
omapdss_compat_uninit();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment