Thread (2 messages) 2 messages, 2 authors, 2009-05-04

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

STALE6362d

From: Krzysztof Helt <hidden>
Date: 2009-05-04 16:59:56
Also in: sparclinux

From: Krzysztof Helt <redacted>

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

Signed-off-by: Krzysztof Helt <redacted>
---

diff -urp linux-orig/drivers/video/igafb.c linux-2.6.30/drivers/video/igafb.c
--- linux-orig/drivers/video/igafb.c	2008-08-09 05:09:03.000000000 +0200
+++ linux-2.6.30/drivers/video/igafb.c	2009-05-04 00:14:28.000000000 +0200
@@ -395,17 +395,16 @@ int __init igafb_init(void)
 	/* We leak a reference here but as it cannot be unloaded this is
 	   fine. If you write unload code remember to free it in unload */
 	
-	size = sizeof(struct fb_info) + sizeof(struct iga_par) + sizeof(u32)*16;
+	size = sizeof(struct iga_par) + sizeof(u32)*16;
 
-        info = kzalloc(size, GFP_ATOMIC);
+	info = framebuffer_alloc(size, &pdev->dev);
         if (!info) {
                 printk("igafb_init: can't alloc fb_info\n");
 		 pci_dev_put(pdev);
                 return -ENOMEM;
         }
 
-	par = (struct iga_par *) (info + 1);
-	
+	par = info->par;
 
 	if ((addr = pdev->resource[0].start) == 0) {
                 printk("igafb_init: no memory start\n");
@@ -526,7 +525,6 @@ int __init igafb_init(void)
 	info->var = default_var;
 	info->fix = igafb_fix;
 	info->pseudo_palette = (void *)(par + 1);
-	info->device = &pdev->dev;
 
 	if (!iga_init(info, par)) {
 		iounmap((void *)par->io_base);

----------------------------------------------------------------------
Szukasz pracy? Sprawd¼ nasze oferty!
http://link.interia.pl/f2142
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help