]> err.no Git - linux-2.6/blobdiff - drivers/mtd/chips/map_rom.c
[MTD] [NAND] corrected MPC8313 NAND fixes
[linux-2.6] / drivers / mtd / chips / map_rom.c
index d59ac01365108f1bc77c12c596d9d035a333027e..cb27f855074c279a65ce23a53cc2615ff9417d55 100644 (file)
@@ -31,22 +31,21 @@ static struct mtd_info *map_rom_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 = &maprom_chipdrv;
        mtd->priv = map;
        mtd->name = map->name;
-       mtd->type = MTD_GENERIC_TYPE;
+       mtd->type = MTD_ROM;
        mtd->size = map->size;
        mtd->read = maprom_read;
        mtd->write = maprom_write;
        mtd->sync = maprom_nop;
        mtd->flags = MTD_CAP_ROM;
        mtd->erasesize = map->size;
+       mtd->writesize = 1;
 
        __module_get(THIS_MODULE);
        return mtd;