]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
OMAPFB: remove manager->device references
authorArchit Taneja <archit@ti.com>
Fri, 20 Jul 2012 12:56:56 +0000 (18:26 +0530)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 26 Sep 2012 11:58:32 +0000 (14:58 +0300)
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: Archit Taneja <archit@ti.com>
drivers/video/omap2/omapfb/omapfb-main.c
drivers/video/omap2/omapfb/omapfb.h

index 77ae9edbf2cde089d77a528c3b576d612444c0fc..b103793516db6d3cbf4582db08cd7a0675c5b903 100644 (file)
@@ -2379,6 +2379,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
        struct omap_overlay *ovl;
        struct omap_dss_device *def_display;
        struct omap_dss_device *dssdev;
+       struct omap_dss_device *ovl_device;
 
        DBG("omapfb_probe\n");
 
@@ -2452,8 +2453,9 @@ static int __init omapfb_probe(struct platform_device *pdev)
        /* gfx overlay should be the default one. find a display
         * connected to that, and use it as default display */
        ovl = omap_dss_get_overlay(0);
-       if (ovl->manager && ovl->manager->device) {
-               def_display = ovl->manager->device;
+       ovl_device = ovl->get_device(ovl);
+       if (ovl_device) {
+               def_display = ovl_device;
        } else {
                dev_warn(&pdev->dev, "cannot find default display\n");
                def_display = NULL;
index 30361a09aecdd231c19d40241733d1aa873e1a79..5ced9b334d35e5861f8fcf3dccee914862405120 100644 (file)
@@ -148,8 +148,9 @@ static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
 
        /* XXX: returns the display connected to first attached overlay */
        for (i = 0; i < ofbi->num_overlays; i++) {
-               if (ofbi->overlays[i]->manager)
-                       return ofbi->overlays[i]->manager->device;
+               struct omap_overlay *ovl = ofbi->overlays[i];
+
+               return ovl->get_device(ovl);
        }
 
        return NULL;