[MTD] replace MTD_ROM with MTD_GENERIC_TYPE

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 30 09:59:01 EDT 2006


Commit:     e369d62e92d526a7ed641e2f0b2978fb0ce366c5
Parent:     e1219724be193519f20743f5500bd1eff11890d0
Author:     Joern Engel <joern at wh.fh-wedel.de>
AuthorDate: Tue May 30 14:25:17 2006 +0200
Commit:     Joern Engel <joern at wh.fh-wedel.de>
CommitDate: Tue May 30 14:25:17 2006 +0200

    [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 at wh.fh-wedel.de>

 drivers/mtd/chips/map_rom.c |    6 ++----
 include/mtd/mtd-abi.h       |    2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index 624c12c..d59ac01 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(st
 	map->fldrv = &maprom_chipdrv;
 	mtd->priv = map;
 	mtd->name = map->name;
-	mtd->type = MTD_ROM;
+	mtd->type = MTD_GENERIC_TYPE;
 	mtd->size = map->size;
 	mtd->read = maprom_read;
 	mtd->write = maprom_write;
 	mtd->sync = maprom_nop;
 	mtd->flags = MTD_CAP_ROM;
-	mtd->erasesize = 131072;
- 	while(mtd->size & (mtd->erasesize - 1))
-		mtd->erasesize >>= 1;
+	mtd->erasesize = map->size;
 
 	__module_get(THIS_MODULE);
 	return mtd;
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index c11a589..1ce365b 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -25,10 +25,10 @@ struct mtd_oob_buf {
 
 #define MTD_ABSENT		0
 #define MTD_RAM			1
-#define MTD_ROM			2
 #define MTD_NORFLASH		3
 #define MTD_NANDFLASH		4
 #define MTD_DATAFLASH		6
+#define MTD_GENERIC_TYPE	7
 
 #define MTD_WRITEABLE		0x400	/* Device is writeable */
 #define MTD_BIT_WRITEABLE	0x800	/* Single bits can be flipped */



More information about the linux-mtd-cvs mailing list