diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-29 11:36:19 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 18:25:51 +0000 |
commit | 122f81d773a464220d64f1a382bde073df281d5a (patch) | |
tree | 20274b156b29a730b79cb83efd6b1dcbd55418d2 /drivers/mtd | |
parent | a88d2dc672192247a6f42c82d558db9bf9258bed (diff) | |
download | linux-122f81d773a464220d64f1a382bde073df281d5a.tar.bz2 |
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')
-rw-r--r-- | drivers/mtd/devices/docprobe.c | 7 |
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) return; } 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) { printk(KERN_WARNING "Cannot allocate memory for data structures. Dropping.\n"); iounmap(docptr); @@ -250,10 +249,6 @@ static void __init DoC_Probe(unsigned long physadr) } this = (struct DiskOnChip *)(&mtd[1]); - - memset((char *)mtd,0, sizeof(struct mtd_info)); - memset((char *)this, 0, sizeof(struct DiskOnChip)); - mtd->priv = this; this->virtadr = docptr; this->physadr = physadr; |