mtd: au1550nd.c: use kzalloc()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Dec 31 15:59:01 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=34970a7db5c73f4c83b72ce989d297a95efb3a6d
Commit:     34970a7db5c73f4c83b72ce989d297a95efb3a6d
Parent:     0f4bd46ec252887f44f1f065b41867cac8f70dfb
Author:     H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Mon Dec 14 16:04:07 2009 -0500
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Dec 31 19:50:23 2009 +0000

    mtd: au1550nd.c: use kzalloc()
    
    Use kzalloc() instead of kmalloc()/memset().
    
    Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/au1550nd.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c
index 92c334f..de190b8 100644
--- a/drivers/mtd/nand/au1550nd.c
+++ b/drivers/mtd/nand/au1550nd.c
@@ -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;



More information about the linux-mtd-cvs mailing list