提交 34970a7d 编写于 作者: H H Hartley Sweeten 提交者: David Woodhouse

mtd: au1550nd.c: use kzalloc()

Use kzalloc() instead of kmalloc()/memset().
Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: NDavid Woodhouse <David.Woodhouse@intel.com>
上级 0f4bd46e
...@@ -450,7 +450,7 @@ static int __init au1xxx_nand_init(void) ...@@ -450,7 +450,7 @@ static int __init au1xxx_nand_init(void)
u32 nand_phys; u32 nand_phys;
/* Allocate memory for MTD device structure and private data */ /* 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) { if (!au1550_mtd) {
printk("Unable to allocate NAND MTD dev structure.\n"); printk("Unable to allocate NAND MTD dev structure.\n");
return -ENOMEM; return -ENOMEM;
...@@ -459,10 +459,6 @@ static int __init au1xxx_nand_init(void) ...@@ -459,10 +459,6 @@ static int __init au1xxx_nand_init(void)
/* Get pointer to private data */ /* Get pointer to private data */
this = (struct nand_chip *)(&au1550_mtd[1]); 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 */ /* Link the private data with the MTD structure */
au1550_mtd->priv = this; au1550_mtd->priv = this;
au1550_mtd->owner = THIS_MODULE; au1550_mtd->owner = THIS_MODULE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册