Commit 4249e61e authored by Archit Taneja's avatar Archit Taneja Committed by Tomi Valkeinen

OMAPFB: remove manager->device references

With the introduction of output entities, managers will now connect to outputs.
Use the helper op for overlays named get_device. This will abstract away the
information on how to get the device from an overlay.

Using the helper function will reduce the number of pointer dereferences a user
of OMAPDSS needs to do and reduce risk of a NULL dereference.
Signed-off-by: default avatarArchit Taneja <archit@ti.com>
parent d629f03f
...@@ -2379,6 +2379,7 @@ static int __init omapfb_probe(struct platform_device *pdev) ...@@ -2379,6 +2379,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
struct omap_overlay *ovl; struct omap_overlay *ovl;
struct omap_dss_device *def_display; struct omap_dss_device *def_display;
struct omap_dss_device *dssdev; struct omap_dss_device *dssdev;
struct omap_dss_device *ovl_device;
DBG("omapfb_probe\n"); DBG("omapfb_probe\n");
...@@ -2452,8 +2453,9 @@ static int __init omapfb_probe(struct platform_device *pdev) ...@@ -2452,8 +2453,9 @@ static int __init omapfb_probe(struct platform_device *pdev)
/* gfx overlay should be the default one. find a display /* gfx overlay should be the default one. find a display
* connected to that, and use it as default display */ * connected to that, and use it as default display */
ovl = omap_dss_get_overlay(0); ovl = omap_dss_get_overlay(0);
if (ovl->manager && ovl->manager->device) { ovl_device = ovl->get_device(ovl);
def_display = ovl->manager->device; if (ovl_device) {
def_display = ovl_device;
} else { } else {
dev_warn(&pdev->dev, "cannot find default display\n"); dev_warn(&pdev->dev, "cannot find default display\n");
def_display = NULL; def_display = NULL;
......
...@@ -148,8 +148,9 @@ static inline struct omap_dss_device *fb2display(struct fb_info *fbi) ...@@ -148,8 +148,9 @@ static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
/* XXX: returns the display connected to first attached overlay */ /* XXX: returns the display connected to first attached overlay */
for (i = 0; i < ofbi->num_overlays; i++) { for (i = 0; i < ofbi->num_overlays; i++) {
if (ofbi->overlays[i]->manager) struct omap_overlay *ovl = ofbi->overlays[i];
return ofbi->overlays[i]->manager->device;
return ovl->get_device(ovl);
} }
return NULL; return NULL;
......
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