aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoern Engel <joern@wh.fh-wedel.de>2006-05-30 08:25:17 -0400
committerJoern Engel <joern@wh.fh-wedel.de>2006-05-30 08:25:17 -0400
commite369d62e92d526a7ed641e2f0b2978fb0ce366c5 (patch)
tree472a4b65509c725a84ca9ecc61516cc904189029
parente1219724be193519f20743f5500bd1eff11890d0 (diff)
[MTD] replace MTD_ROM with MTD_GENERIC_TYPE
No mtd user should ever check for the device type. Instead, device features should be checked by the flags - if at all. As a first step towards type removal, change MTD_ROM into MTD_GENERIC_TYPE. Signed-off-by: Joern Engel <joern@wh.fh-wedel.de>
-rw-r--r--drivers/mtd/chips/map_rom.c6
-rw-r--r--include/mtd/mtd-abi.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index 624c12c232c8..d59ac0136510 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -40,15 +40,13 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
40 map->fldrv = &maprom_chipdrv; 40 map->fldrv = &maprom_chipdrv;
41 mtd->priv = map; 41 mtd->priv = map;
42 mtd->name = map->name; 42 mtd->name = map->name;
43 mtd->type = MTD_ROM; 43 mtd->type = MTD_GENERIC_TYPE;
44 mtd->size = map->size; 44 mtd->size = map->size;
45 mtd->read = maprom_read; 45 mtd->read = maprom_read;
46 mtd->write = maprom_write; 46 mtd->write = maprom_write;
47 mtd->sync = maprom_nop; 47 mtd->sync = maprom_nop;
48 mtd->flags = MTD_CAP_ROM; 48 mtd->flags = MTD_CAP_ROM;
49 mtd->erasesize = 131072; 49 mtd->erasesize = map->size;
50 while(mtd->size & (mtd->erasesize - 1))
51 mtd->erasesize >>= 1;
52 50
53 __module_get(THIS_MODULE); 51 __module_get(THIS_MODULE);
54 return mtd; 52 return mtd;
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index c11a589bdedf..1ce365bd31d2 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -25,10 +25,10 @@ struct mtd_oob_buf {
25 25
26#define MTD_ABSENT 0 26#define MTD_ABSENT 0
27#define MTD_RAM 1 27#define MTD_RAM 1
28#define MTD_ROM 2
29#define MTD_NORFLASH 3 28#define MTD_NORFLASH 3
30#define MTD_NANDFLASH 4 29#define MTD_NANDFLASH 4
31#define MTD_DATAFLASH 6 30#define MTD_DATAFLASH 6
31#define MTD_GENERIC_TYPE 7
32 32
33#define MTD_WRITEABLE 0x400 /* Device is writeable */ 33#define MTD_WRITEABLE 0x400 /* Device is writeable */
34#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ 34#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */