Documentation/DocBook/mtdnand.tmpl: kmalloc + memset conversion to kzalloc
authorMariusz Kozlowski <m.kozlowski@tuxland.pl>
Tue, 31 Jul 2007 21:22:18 +0000 (23:22 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 1 Aug 2007 10:03:17 +0000 (11:03 +0100)
Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Documentation/DocBook/mtdnand.tmpl

index a8c8cce..6fbc41d 100644 (file)
@@ -275,16 +275,13 @@ int __init board_init (void)
        int err = 0;
 
        /* Allocate memory for MTD device structure and private data */
-       board_mtd = kmalloc (sizeof(struct mtd_info) + sizeof (struct nand_chip), GFP_KERNEL);
+       board_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
        if (!board_mtd) {
                printk ("Unable to allocate NAND MTD device structure.\n");
                err = -ENOMEM;
                goto out;
        }
 
-       /* Initialize structures */
-       memset ((char *) board_mtd, 0, sizeof(struct mtd_info) + sizeof(struct nand_chip));
-
        /* map physical adress */
        baseaddr = (unsigned long)ioremap(CHIP_PHYSICAL_ADDRESS, 1024);
        if(!baseaddr){