]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/mtd/devices/phram.c
Merge ../linux-2.6-watchdog-mm
[linux-2.6-omap-h63xx.git] / drivers / mtd / devices / phram.c
index e09e416667d38daea36e24b8034daa86597adb79..56cc1ca7ffd5e7d8c552c47d3d0089fe4014c2e6 100644 (file)
@@ -126,12 +126,10 @@ static int register_device(char *name, unsigned long start, unsigned long len)
        struct phram_mtd_list *new;
        int ret = -ENOMEM;
 
-       new = kmalloc(sizeof(*new), GFP_KERNEL);
+       new = kzalloc(sizeof(*new), GFP_KERNEL);
        if (!new)
                goto out0;
 
-       memset(new, 0, sizeof(*new));
-
        ret = -EIO;
        new->mtd.priv = ioremap(start, len);
        if (!new->mtd.priv) {
@@ -151,6 +149,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
        new->mtd.owner = THIS_MODULE;
        new->mtd.type = MTD_RAM;
        new->mtd.erasesize = PAGE_SIZE;
+       new->mtd.writesize = 1;
 
        ret = -EAGAIN;
        if (add_mtd_device(&new->mtd)) {