All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH] omapfb: Reorder Register_framebuffer call
@ 2009-08-20 20:12 Aguirre Rodriguez, Sergio Alberto
  2009-09-04  6:44 ` Gadiyar, Anand
  0 siblings, 1 reply; 6+ messages in thread
From: Aguirre Rodriguez, Sergio Alberto @ 2009-08-20 20:12 UTC (permalink / raw)
  To: linux-fbdev-devel@lists.sourceforge.net
  Cc: Imre Deak, linux-omap@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

From: Sergio Aguirre <saaguirre@ti.com>

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

Signed-off-by: Sergio Aguirre <saaguirre@ti.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


[-- Attachment #2: 0001-omapfb-Reorder-Register_framebuffer-call.patch --]
[-- Type: application/octet-stream, Size: 1681 bytes --]

From bf68134c0d13c9df618d9ef4d3e9d065585f3d15 Mon Sep 17 00:00:00 2001
From: Sergio Aguirre <saaguirre@ti.com>
Date: Thu, 20 Aug 2009 14:58:22 -0500
Subject: [PATCH] omapfb: Reorder Register_framebuffer call

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

Signed-off-by: Sergio Aguirre <saaguirre@ti.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] 6+ messages in thread

end of thread, other threads:[~2009-09-05  1:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-20 20:12 [RFC][PATCH] omapfb: Reorder Register_framebuffer call Aguirre Rodriguez, Sergio Alberto
2009-09-04  6:44 ` Gadiyar, Anand
2009-09-04  8:33   ` Hiremath, Vaibhav
2009-09-04 13:34   ` Peter Barada
2009-09-04 17:15     ` New and improved omapzoom.org Joshi, Rhishi
2009-09-05  1:41     ` [RFC][PATCH] omapfb: Reorder Register_framebuffer call Eric Witcher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.