aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-07-20 08:56:56 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-09-26 07:58:32 -0400
commit4249e61e0440f01d279fa21d121dbf069e6620fa (patch)
tree4744bd17c3b1aa5bdb352f912fb6145074883761 /drivers/video
parentd629f03f748c46277c421ed5b892f0b39fd1fe47 (diff)
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: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c6
-rw-r--r--drivers/video/omap2/omapfb/omapfb.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 77ae9edbf2cd..b103793516db 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2379,6 +2379,7 @@ static int __init omapfb_probe(struct platform_device *pdev)
2379 struct omap_overlay *ovl; 2379 struct omap_overlay *ovl;
2380 struct omap_dss_device *def_display; 2380 struct omap_dss_device *def_display;
2381 struct omap_dss_device *dssdev; 2381 struct omap_dss_device *dssdev;
2382 struct omap_dss_device *ovl_device;
2382 2383
2383 DBG("omapfb_probe\n"); 2384 DBG("omapfb_probe\n");
2384 2385
@@ -2452,8 +2453,9 @@ static int __init omapfb_probe(struct platform_device *pdev)
2452 /* gfx overlay should be the default one. find a display 2453 /* gfx overlay should be the default one. find a display
2453 * connected to that, and use it as default display */ 2454 * connected to that, and use it as default display */
2454 ovl = omap_dss_get_overlay(0); 2455 ovl = omap_dss_get_overlay(0);
2455 if (ovl->manager && ovl->manager->device) { 2456 ovl_device = ovl->get_device(ovl);
2456 def_display = ovl->manager->device; 2457 if (ovl_device) {
2458 def_display = ovl_device;
2457 } else { 2459 } else {
2458 dev_warn(&pdev->dev, "cannot find default display\n"); 2460 dev_warn(&pdev->dev, "cannot find default display\n");
2459 def_display = NULL; 2461 def_display = NULL;
diff --git a/drivers/video/omap2/omapfb/omapfb.h b/drivers/video/omap2/omapfb/omapfb.h
index 30361a09aecd..5ced9b334d35 100644
--- a/drivers/video/omap2/omapfb/omapfb.h
+++ b/drivers/video/omap2/omapfb/omapfb.h
@@ -148,8 +148,9 @@ static inline struct omap_dss_device *fb2display(struct fb_info *fbi)
148 148
149 /* XXX: returns the display connected to first attached overlay */ 149 /* XXX: returns the display connected to first attached overlay */
150 for (i = 0; i < ofbi->num_overlays; i++) { 150 for (i = 0; i < ofbi->num_overlays; i++) {
151 if (ofbi->overlays[i]->manager) 151 struct omap_overlay *ovl = ofbi->overlays[i];
152 return ofbi->overlays[i]->manager->device; 152
153 return ovl->get_device(ovl);
153 } 154 }
154 155
155 return NULL; 156 return NULL;