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 | 4113819eb360555a91a8291f37bbbe9d26c5b275 (patch) | |
tree | aaf774921257dab5bfc51926f65589abdde7fd1b /drivers/video/offb.c | |
parent | 100b4a6eefb2ec335a2ae82356dad1b506ded8ed (diff) |
offb: 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>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.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/offb.c')
-rw-r--r-- | drivers/video/offb.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c index e1d9eeb1aea..bb915a43dd6 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c | |||
@@ -378,7 +378,6 @@ static void __init offb_init_fb(const char *name, const char *full_name, | |||
378 | struct fb_fix_screeninfo *fix; | 378 | struct fb_fix_screeninfo *fix; |
379 | struct fb_var_screeninfo *var; | 379 | struct fb_var_screeninfo *var; |
380 | struct fb_info *info; | 380 | struct fb_info *info; |
381 | int size; | ||
382 | 381 | ||
383 | if (!request_mem_region(res_start, res_size, "offb")) | 382 | if (!request_mem_region(res_start, res_size, "offb")) |
384 | return; | 383 | return; |
@@ -393,15 +392,12 @@ static void __init offb_init_fb(const char *name, const char *full_name, | |||
393 | return; | 392 | return; |
394 | } | 393 | } |
395 | 394 | ||
396 | size = sizeof(struct fb_info) + sizeof(u32) * 16; | 395 | info = framebuffer_alloc(sizeof(u32) * 16, NULL); |
397 | |||
398 | info = kmalloc(size, GFP_ATOMIC); | ||
399 | 396 | ||
400 | if (info == 0) { | 397 | if (info == 0) { |
401 | release_mem_region(res_start, res_size); | 398 | release_mem_region(res_start, res_size); |
402 | return; | 399 | return; |
403 | } | 400 | } |
404 | memset(info, 0, size); | ||
405 | 401 | ||
406 | fix = &info->fix; | 402 | fix = &info->fix; |
407 | var = &info->var; | 403 | var = &info->var; |