From: Jiri Slaby Date: Tue, 19 Sep 2006 19:55:18 +0000 (+0200) Subject: [MTD] pmc551 use kzalloc X-Git-Tag: v2.6.19-rc1~1299^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fefb924d7aed7116fe2a68cdbfc9e36318e7300;p=linux-2.6 [MTD] pmc551 use kzalloc Use kzalloc instad of kmalloc+memset(0). Signed-off-by: Jiri Slaby Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index 4d4023601d..62a918895d 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c @@ -732,23 +732,20 @@ static int __init init_pmc551(void) msize = length; } - mtd = kmalloc(sizeof(struct mtd_info), GFP_KERNEL); + mtd = kzalloc(sizeof(struct mtd_info), GFP_KERNEL); if (!mtd) { printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " "device.\n"); break; } - memset(mtd, 0, sizeof(struct mtd_info)); - - priv = kmalloc(sizeof(struct mypriv), GFP_KERNEL); + priv = kzalloc(sizeof(struct mypriv), GFP_KERNEL); if (!priv) { printk(KERN_NOTICE "pmc551: Cannot allocate new MTD " "device.\n"); kfree(mtd); break; } - memset(priv, 0, sizeof(*priv)); mtd->priv = priv; priv->dev = PCI_Device;