diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-02-12 03:55:12 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-12 12:48:43 -0500 |
commit | f5610b9c3a2896fcaa623b92d0f24d83f10bb2c0 (patch) | |
tree | f4ff35f5991debf0f892794687abc574cdaacb4f /drivers/video/au1100fb.c | |
parent | c4f28e54d61278203c2bb2aea0679e0a738235d2 (diff) |
[PATCH] Video: fb, kzalloc changes
Use kzalloc instead of kmalloc + memset(0).
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/au1100fb.c')
-rw-r--r-- | drivers/video/au1100fb.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/video/au1100fb.c b/drivers/video/au1100fb.c index ef5c16f7f5a..80a81eccad3 100644 --- a/drivers/video/au1100fb.c +++ b/drivers/video/au1100fb.c | |||
@@ -468,11 +468,10 @@ int au1100fb_drv_probe(struct device *dev) | |||
468 | return -EINVAL; | 468 | return -EINVAL; |
469 | 469 | ||
470 | /* Allocate new device private */ | 470 | /* Allocate new device private */ |
471 | if (!(fbdev = kmalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) { | 471 | if (!(fbdev = kzalloc(sizeof(struct au1100fb_device), GFP_KERNEL))) { |
472 | print_err("fail to allocate device private record"); | 472 | print_err("fail to allocate device private record"); |
473 | return -ENOMEM; | 473 | return -ENOMEM; |
474 | } | 474 | } |
475 | memset((void*)fbdev, 0, sizeof(struct au1100fb_device)); | ||
476 | 475 | ||
477 | fbdev->panel = &known_lcd_panels[drv_info.panel_idx]; | 476 | fbdev->panel = &known_lcd_panels[drv_info.panel_idx]; |
478 | 477 | ||
@@ -549,10 +548,9 @@ int au1100fb_drv_probe(struct device *dev) | |||
549 | fbdev->info.fbops = &au1100fb_ops; | 548 | fbdev->info.fbops = &au1100fb_ops; |
550 | fbdev->info.fix = au1100fb_fix; | 549 | fbdev->info.fix = au1100fb_fix; |
551 | 550 | ||
552 | if (!(fbdev->info.pseudo_palette = kmalloc(sizeof(u32) * 16, GFP_KERNEL))) { | 551 | if (!(fbdev->info.pseudo_palette = kzalloc(sizeof(u32) * 16, GFP_KERNEL))) { |
553 | return -ENOMEM; | 552 | return -ENOMEM; |
554 | } | 553 | } |
555 | memset(fbdev->info.pseudo_palette, 0, sizeof(u32) * 16); | ||
556 | 554 | ||
557 | if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { | 555 | if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { |
558 | print_err("Fail to allocate colormap (%d entries)", | 556 | print_err("Fail to allocate colormap (%d entries)", |