diff options
Diffstat (limited to 'drivers/video/offb.c')
-rw-r--r-- | drivers/video/offb.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c index e1d9eeb1aeaf..4d8c54c23dd7 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; |
@@ -497,7 +493,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, | |||
497 | iounmap(par->cmap_adr); | 493 | iounmap(par->cmap_adr); |
498 | par->cmap_adr = NULL; | 494 | par->cmap_adr = NULL; |
499 | iounmap(info->screen_base); | 495 | iounmap(info->screen_base); |
500 | kfree(info); | 496 | framebuffer_release(info); |
501 | release_mem_region(res_start, res_size); | 497 | release_mem_region(res_start, res_size); |
502 | return; | 498 | return; |
503 | } | 499 | } |