Skip to content

Commit

Permalink
OMAPDSS: use omapdss_compat_init() in other drivers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tomi Valkeinen committed Dec 7, 2012
1 parent 348be69 commit a9ee9f0
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
17 changes: 14 additions & 3 deletions drivers/media/platform/omap/omap_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -2286,6 +2295,8 @@ static int __init omap_vout_probe(struct platform_device *pdev)
}
probe_err0:
kfree(vid_dev);
err_dss_init:
omapdss_compat_uninit();
return ret;
}

Expand Down
11 changes: 11 additions & 0 deletions drivers/staging/omapdrm/omap_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;

Expand Down
4 changes: 0 additions & 4 deletions drivers/video/omap2/dss/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -258,8 +256,6 @@ static int omap_dss_remove(struct platform_device *pdev)

dss_uninitialize_debugfs();

omapdss_compat_uninit();

return 0;
}

Expand Down
6 changes: 6 additions & 0 deletions drivers/video/omap2/omapfb/omapfb-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -2559,6 +2563,8 @@ static int __exit omapfb_remove(struct platform_device *pdev)

omapfb_free_resources(fbdev);

omapdss_compat_uninit();

return 0;
}

Expand Down

0 comments on commit a9ee9f0

Please sign in to comment.