linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] omapfb: Reorder Register_framebuffer call
@ 2009-09-12 16:34 Sergio Aguirre
  2009-09-14 14:43 ` Aguirre Rodriguez, Sergio Alberto
       [not found] ` <notify-1253583118@atomide.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Sergio Aguirre @ 2009-09-12 16:34 UTC (permalink / raw)
  To: Imre Deak; +Cc: linux-fbdev-devel, linux-omap, Sergio Aguirre

This fixes the issue in which mm_lock mutex was attempted to be
used without initializing previously.

Thanks to the testers!
 - OMAP3430 SDP (Anand Gadiyar)
 - OMAP3530 EVM (Vaibhav Hiremath)
 - LogicPD's OMAP boards (Peter Brada)
 - Beagleboard Rev. C2 (Eric Witcher)

Signed-off-by: Sergio Aguirre <saaguirre@ti.com>
Tested-by: Vaibhav Hiremath <hvaibhav@ti.com>
Tested-by: Anand Gadiyar <gadiyar@ti.com>
Tested-by: Peter Barada <peterb@logicpd.com>
Tested-by: Eric Witcher <ewitcher@mindspring.com>
---
 drivers/video/omap/omapfb_main.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c
index 125e605..60f9482 100644
--- a/drivers/video/omap/omapfb_main.c
+++ b/drivers/video/omap/omapfb_main.c
@@ -1503,12 +1503,21 @@ static int fbinfo_init(struct omapfb_device *fbdev, struct fb_info *info)
 	var->rotate	  = def_rotate;
 	var->bits_per_pixel = fbdev->panel->bpp;
 
+	r = register_framebuffer(info);
+	if (r != 0) {
+		dev_err(fbdev->dev,
+			"registering framebuffer failed\n");
+		return r;
+	}
+
 	set_fb_var(info, var);
 	set_fb_fix(info);
 
 	r = fb_alloc_cmap(&info->cmap, 16, 0);
-	if (r != 0)
+	if (r != 0) {
 		dev_err(fbdev->dev, "unable to allocate color map memory\n");
+		unregister_framebuffer(info);
+	}
 
 	return r;
 }
@@ -1773,15 +1782,8 @@ static int omapfb_do_probe(struct platform_device *pdev,
 	init_state++;
 
 	vram = 0;
-	for (i = 0; i < fbdev->mem_desc.region_cnt; i++) {
-		r = register_framebuffer(fbdev->fb_info[i]);
-		if (r != 0) {
-			dev_err(fbdev->dev,
-				"registering framebuffer %d failed\n", i);
-			goto cleanup;
-		}
+	for (i = 0; i < fbdev->mem_desc.region_cnt; i++)
 		vram += fbdev->mem_desc.region[i].size;
-	}
 
 	fbdev->state = OMAPFB_ACTIVE;
 
-- 
1.6.3.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-25 10:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-12 16:34 [PATCH] omapfb: Reorder Register_framebuffer call Sergio Aguirre
2009-09-14 14:43 ` Aguirre Rodriguez, Sergio Alberto
2009-09-14 15:22   ` Felipe Contreras
     [not found] ` <notify-1253583118@atomide.com>
     [not found]   ` <4de7f8a60909220759g63b592eek85a2bca04b264d2e@mail.gmail.com>
2009-09-22 16:28     ` [APPLIED] " Tony Lindgren
2009-09-22 16:57       ` Aguirre Rodriguez, Sergio Alberto
2009-09-23 17:03         ` Jan Blunck
2009-09-25 10:13           ` [Linux-fbdev-devel] " Florian Tobias Schandinat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).