[MTD] Restore MTD_ROM and MTD_RAM types

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Jun 14 16:59:02 EDT 2006


Commit:     21c8db9eff95260e543535dfc6f27164c4c0c0ff
Parent:     783ed81ff39d3f938a6b2efd09fbad96e41e5c1f
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Wed Jun 14 21:39:48 2006 +0100
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Wed Jun 14 21:39:48 2006 +0100

    [MTD] Restore MTD_ROM and MTD_RAM types
    
    Let's not attempt the abolition of mtd->type until/unless it's properly
    thought through. And certainly, let's not do it by halves.
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

 drivers/mtd/chips/map_ram.c     |    2 +-
 drivers/mtd/chips/map_rom.c     |    2 +-
 drivers/mtd/devices/block2mtd.c |    2 +-
 drivers/mtd/devices/ms02-nv.c   |    2 +-
 drivers/mtd/devices/mtdram.c    |    2 +-
 drivers/mtd/devices/phram.c     |    2 +-
 drivers/mtd/devices/pmc551.c    |    2 +-
 drivers/mtd/devices/slram.c     |    2 +-
 include/mtd/mtd-abi.h           |    3 ++-
 9 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/chips/map_ram.c b/drivers/mtd/chips/map_ram.c
index 9b7c499..7639257 100644
--- a/drivers/mtd/chips/map_ram.c
+++ b/drivers/mtd/chips/map_ram.c
@@ -64,7 +64,7 @@ #endif
 	map->fldrv = &mapram_chipdrv;
 	mtd->priv = map;
 	mtd->name = map->name;
-	mtd->type = MTD_GENERIC_TYPE;
+	mtd->type = MTD_RAM;
 	mtd->size = map->size;
 	mtd->erase = mapram_erase;
 	mtd->read = mapram_read;
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c
index d59ac01..bc6ee9e 100644
--- a/drivers/mtd/chips/map_rom.c
+++ b/drivers/mtd/chips/map_rom.c
@@ -40,7 +40,7 @@ static struct mtd_info *map_rom_probe(st
 	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;
diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index 1157182..0d98c22 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -324,7 +324,7 @@ static struct block2mtd_dev *add_device(
 
 	dev->mtd.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
 	dev->mtd.erasesize = erase_size;
-	dev->mtd.type = MTD_GENERIC_TYPE;
+	dev->mtd.type = MTD_RAM;
 	dev->mtd.flags = MTD_CAP_RAM;
 	dev->mtd.erase = block2mtd_erase;
 	dev->mtd.write = block2mtd_write;
diff --git a/drivers/mtd/devices/ms02-nv.c b/drivers/mtd/devices/ms02-nv.c
index a6466f9..4ab7670 100644
--- a/drivers/mtd/devices/ms02-nv.c
+++ b/drivers/mtd/devices/ms02-nv.c
@@ -218,7 +218,7 @@ static int __init ms02nv_init_one(ulong 
 	fixsize = (size - (fixaddr - addr)) & ~(PAGE_SIZE - 1);
 	mp->uaddr = phys_to_virt(fixaddr);
 
-	mtd->type = MTD_GENERIC_TYPE;
+	mtd->type = MTD_RAM;
 	mtd->flags = MTD_CAP_RAM;
 	mtd->size = fixsize;
 	mtd->name = (char *)ms02nv_name;
diff --git a/drivers/mtd/devices/mtdram.c b/drivers/mtd/devices/mtdram.c
index 8ab4b93..b4438ea 100644
--- a/drivers/mtd/devices/mtdram.c
+++ b/drivers/mtd/devices/mtdram.c
@@ -103,7 +103,7 @@ int mtdram_init_device(struct mtd_info *
 
 	/* Setup the MTD structure */
 	mtd->name = name;
-	mtd->type = MTD_GENERIC_TYPE;
+	mtd->type = MTD_RAM;
 	mtd->flags = MTD_CAP_RAM;
 	mtd->size = size;
 	mtd->writesize = 1;
diff --git a/drivers/mtd/devices/phram.c b/drivers/mtd/devices/phram.c
index e6daa74..e09e416 100644
--- a/drivers/mtd/devices/phram.c
+++ b/drivers/mtd/devices/phram.c
@@ -149,7 +149,7 @@ static int register_device(char *name, u
 	new->mtd.read = phram_read;
 	new->mtd.write = phram_write;
 	new->mtd.owner = THIS_MODULE;
-	new->mtd.type = MTD_GENERIC_TYPE;
+	new->mtd.type = MTD_RAM;
 	new->mtd.erasesize = PAGE_SIZE;
 
 	ret = -EAGAIN;
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index aa9f6c9..666cce1 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -775,7 +775,7 @@ #endif
                 mtd->write 	= pmc551_write;
                 mtd->point 	= pmc551_point;
                 mtd->unpoint 	= pmc551_unpoint;
-                mtd->type	= MTD_GENERIC_TYPE;
+                mtd->type 	= MTD_RAM;
                 mtd->name 	= "PMC551 RAM board";
                 mtd->erasesize 	= 0x10000;
 		mtd->owner = THIS_MODULE;
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
index fdb7a78..b3f665e 100644
--- a/drivers/mtd/devices/slram.c
+++ b/drivers/mtd/devices/slram.c
@@ -207,7 +207,7 @@ static int register_device(char *name, u
 	(*curmtd)->mtdinfo->read = slram_read;
 	(*curmtd)->mtdinfo->write = slram_write;
 	(*curmtd)->mtdinfo->owner = THIS_MODULE;
-	(*curmtd)->mtdinfo->type = MTD_GENERIC_TYPE;
+	(*curmtd)->mtdinfo->type = MTD_RAM;
 	(*curmtd)->mtdinfo->erasesize = SLRAM_BLK_SZ;
 
 	if (add_mtd_device((*curmtd)->mtdinfo))	{
diff --git a/include/mtd/mtd-abi.h b/include/mtd/mtd-abi.h
index 7ccadb1..ee2afba 100644
--- a/include/mtd/mtd-abi.h
+++ b/include/mtd/mtd-abi.h
@@ -24,10 +24,11 @@ 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