]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mtd: au1550nd.c: use kzalloc()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 14 Dec 2009 21:04:07 +0000 (16:04 -0500)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 31 Dec 2009 19:50:23 +0000 (19:50 +0000)
Use kzalloc() instead of kmalloc()/memset().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/au1550nd.c

index 92c334ff450885a8d06179ac14a4276c3805b933..de190b8f8a101283d42313a8c5fade9914f5fbda 100644 (file)
@@ -450,7 +450,7 @@ static int __init au1xxx_nand_init(void)
        u32 nand_phys;
 
        /* Allocate memory for MTD device structure and private data */
-       au1550_mtd = kmalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
+       au1550_mtd = kzalloc(sizeof(struct mtd_info) + sizeof(struct nand_chip), GFP_KERNEL);
        if (!au1550_mtd) {
                printk("Unable to allocate NAND MTD dev structure.\n");
                return -ENOMEM;
@@ -459,10 +459,6 @@ static int __init au1xxx_nand_init(void)
        /* Get pointer to private data */
        this = (struct nand_chip *)(&au1550_mtd[1]);
 
-       /* Initialize structures */
-       memset(au1550_mtd, 0, sizeof(struct mtd_info));
-       memset(this, 0, sizeof(struct nand_chip));
-
        /* Link the private data with the MTD structure */
        au1550_mtd->priv = this;
        au1550_mtd->owner = THIS_MODULE;