fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / mtd / chips / map_absent.c
index a611de9..fc478c0 100644 (file)
@@ -47,13 +47,11 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
 {
        struct mtd_info *mtd;
 
-       mtd = kmalloc(sizeof(*mtd), GFP_KERNEL);
+       mtd = kzalloc(sizeof(*mtd), GFP_KERNEL);
        if (!mtd) {
                return NULL;
        }
 
-       memset(mtd, 0, sizeof(*mtd));
-
        map->fldrv      = &map_absent_chipdrv;
        mtd->priv       = map;
        mtd->name       = map->name;
@@ -64,7 +62,8 @@ static struct mtd_info *map_absent_probe(struct map_info *map)
        mtd->write      = map_absent_write;
        mtd->sync       = map_absent_sync;
        mtd->flags      = 0;
-       mtd->erasesize = PAGE_SIZE;
+       mtd->erasesize  = PAGE_SIZE;
+       mtd->writesize  = 1;
 
        __module_get(THIS_MODULE);
        return mtd;