Commit 122f81d7 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse

mtd: docprobe: use kzalloc instead

Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'.
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent a88d2dc6
...@@ -241,8 +241,7 @@ static void __init DoC_Probe(unsigned long physadr) ...@@ -241,8 +241,7 @@ static void __init DoC_Probe(unsigned long physadr)
return; return;
} }
docfound = 1; docfound = 1;
mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); mtd = kzalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
if (!mtd) { if (!mtd) {
printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n"); printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n");
iounmap(docptr); iounmap(docptr);
...@@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr) ...@@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr)
} }
this = (struct DiskOnChip *)(&mtd[1]); this = (struct DiskOnChip *)(&mtd[1]);
memset((char *)mtd,0, sizeof(struct mtd_info));
memset((char *)this, 0, sizeof(struct DiskOnChip));
mtd->priv = this; mtd->priv = this;
this->virtadr = docptr; this->virtadr = docptr;
this->physadr = physadr; this->physadr = physadr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment