diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2009-06-16 18:34:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-16 22:47:58 -0400 |
commit | 100b4a6eefb2ec335a2ae82356dad1b506ded8ed (patch) | |
tree | 2b70177f35b18c7dd0c273263365b0a828f6fd87 /drivers/video/igafb.c | |
parent | 7ec42d2659e81f068c5392fd5cb2f5b4bd35e880 (diff) |
igafb: use framebuffer_alloc() to allocate fb_info struct
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@wp.pl>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/igafb.c')
-rw-r--r-- | drivers/video/igafb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c index 3a81060137a2..15d200109446 100644 --- a/drivers/video/igafb.c +++ b/drivers/video/igafb.c | |||
@@ -395,17 +395,16 @@ int __init igafb_init(void) | |||
395 | /* We leak a reference here but as it cannot be unloaded this is | 395 | /* We leak a reference here but as it cannot be unloaded this is |
396 | fine. If you write unload code remember to free it in unload */ | 396 | fine. If you write unload code remember to free it in unload */ |
397 | 397 | ||
398 | size = sizeof(struct fb_info) + sizeof(struct iga_par) + sizeof(u32)*16; | 398 | size = sizeof(struct iga_par) + sizeof(u32)*16; |
399 | 399 | ||
400 | info = kzalloc(size, GFP_ATOMIC); | 400 | info = framebuffer_alloc(size, &pdev->dev); |
401 | if (!info) { | 401 | if (!info) { |
402 | printk("igafb_init: can't alloc fb_info\n"); | 402 | printk("igafb_init: can't alloc fb_info\n"); |
403 | pci_dev_put(pdev); | 403 | pci_dev_put(pdev); |
404 | return -ENOMEM; | 404 | return -ENOMEM; |
405 | } | 405 | } |
406 | 406 | ||
407 | par = (struct iga_par *) (info + 1); | 407 | par = info->par; |
408 | |||
409 | 408 | ||
410 | if ((addr = pdev->resource[0].start) == 0) { | 409 | if ((addr = pdev->resource[0].start) == 0) { |
411 | printk("igafb_init: no memory start\n"); | 410 | printk("igafb_init: no memory start\n"); |
@@ -526,7 +525,6 @@ int __init igafb_init(void) | |||
526 | info->var = default_var; | 525 | info->var = default_var; |
527 | info->fix = igafb_fix; | 526 | info->fix = igafb_fix; |
528 | info->pseudo_palette = (void *)(par + 1); | 527 | info->pseudo_palette = (void *)(par + 1); |
529 | info->device = &pdev->dev; | ||
530 | 528 | ||
531 | if (!iga_init(info, par)) { | 529 | if (!iga_init(info, par)) { |
532 | iounmap((void *)par->io_base); | 530 | iounmap((void *)par->io_base); |