aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-29 04:36:19 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:25:51 -0500
commit122f81d773a464220d64f1a382bde073df281d5a (patch)
tree20274b156b29a730b79cb83efd6b1dcbd55418d2 /drivers/mtd/devices
parenta88d2dc672192247a6f42c82d558db9bf9258bed (diff)
mtd: docprobe: use kzalloc instead
Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docprobe.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index 45116bb30297..706b847b46b3 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -241,8 +241,7 @@ static void __init DoC_Probe(unsigned long physadr)
241 return; 241 return;
242 } 242 }
243 docfound = 1; 243 docfound = 1;
244 mtd = kmalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL); 244 mtd = kzalloc(sizeof(struct DiskOnChip) + sizeof(struct mtd_info), GFP_KERNEL);
245
246 if (!mtd) { 245 if (!mtd) {
247 printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n"); 246 printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n");
248 iounmap(docptr); 247 iounmap(docptr);
@@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr)
250 } 249 }
251 250
252 this = (struct DiskOnChip *)(&mtd[1]); 251 this = (struct DiskOnChip *)(&mtd[1]);
253
254 memset((char *)mtd,0, sizeof(struct mtd_info));
255 memset((char *)this, 0, sizeof(struct DiskOnChip));
256
257 mtd->priv = this; 252 mtd->priv = this;
258 this->virtadr = docptr; 253 this->virtadr = docptr;
259 this->physadr = physadr; 254 this->physadr = physadr;