[PATCH] offb: use framebuffer_alloc() to allocate fb_info struct

Krzysztof Helt krzysztof.h1 at poczta.fm
Tue May 5 03:07:24 EST 2009


From: Krzysztof Helt <krzysztof.h1 at wp.pl>

Use the framebuffer_alloc() function to allocate the fb_info
structure so the structure is correctly initialized after allocation.

Signed-off-by: Krzysztof Helt <krzysztof.h1 at wp.pl>
---

diff -urp linux-orig/drivers/video/offb.c linux-2.6.30/drivers/video/offb.c
--- linux-orig/drivers/video/offb.c	2008-08-09 05:09:05.000000000 +0200
+++ linux-2.6.30/drivers/video/offb.c	2009-05-04 00:14:28.000000000 +0200
@@ -378,7 +378,6 @@ static void __init offb_init_fb(const ch
 	struct fb_fix_screeninfo *fix;
 	struct fb_var_screeninfo *var;
 	struct fb_info *info;
-	int size;
 
 	if (!request_mem_region(res_start, res_size, "offb"))
 		return;
@@ -393,15 +392,12 @@ static void __init offb_init_fb(const ch
 		return;
 	}
 
-	size = sizeof(struct fb_info) + sizeof(u32) * 16;
-
-	info = kmalloc(size, GFP_ATOMIC);
+	info = framebuffer_alloc(sizeof(u32) * 16, NULL);
 	
 	if (info == 0) {
 		release_mem_region(res_start, res_size);
 		return;
 	}
-	memset(info, 0, size);
 
 	fix = &info->fix;
 	var = &info->var;

----------------------------------------------------------------------
Wygraj 3000 zl, wycieczke lub lot balonem!
Sprawdz >> http://link.interia.pl/f2154




More information about the Linuxppc-dev mailing list