]> err.no Git - linux-2.6/commitdiff
[MTD] pmc551 use kzalloc
authorJiri Slaby <jirislaby@gmail.com>
Tue, 19 Sep 2006 19:55:18 +0000 (21:55 +0200)
committerDavid Woodhouse <dwmw2@infradead.org>
Fri, 22 Sep 2006 09:33:52 +0000 (10:33 +0100)
Use kzalloc instad of kmalloc+memset(0).

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/devices/pmc551.c

index 4d4023601d22a9462920c667a6a8d7fca179200e..62a918895df4cb767db9118110b19d1b94c29867 100644 (file)
@@ -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;