]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/inftlmount.c
leds: Add support for hardware accelerated LED flashing
[linux-2.6-omap-h63xx.git] / drivers / mtd / inftlmount.c
index 8f6006f1a519480c3fbba9581294b901bc2571b9..b8917beeb65099262da1e316282d663e43933e39 100644 (file)
 #include <asm/io.h>
 #include <asm/uaccess.h>
 #include <linux/miscdevice.h>
-#include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/nftl.h>
@@ -582,14 +580,13 @@ int INFTL_mount(struct INFTLrecord *s)
        logical_block = block = BLOCK_NIL;
 
        /* Temporary buffer to store ANAC numbers. */
-       ANACtable = kmalloc(s->nb_blocks * sizeof(u8), GFP_KERNEL);
+       ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
        if (!ANACtable) {
                printk(KERN_WARNING "INFTL: allocation of ANACtable "
                                "failed (%zd bytes)\n",
                                s->nb_blocks * sizeof(u8));
                return -ENOMEM;
        }
-       memset(ANACtable, 0, s->nb_blocks);
 
        /*
         * First pass is to explore each physical unit, and construct the