]> err.no Git - linux-2.6/commitdiff
[MTD] Restore MTD_ROM and MTD_RAM types
authorDavid Woodhouse <dwmw2@infradead.org>
Wed, 14 Jun 2006 20:39:48 +0000 (21:39 +0100)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 14 Jun 2006 20:39:48 +0000 (21:39 +0100)
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@infradead.org>
drivers/mtd/chips/map_ram.c
drivers/mtd/chips/map_rom.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/ms02-nv.c
drivers/mtd/devices/mtdram.c
drivers/mtd/devices/phram.c
drivers/mtd/devices/pmc551.c
drivers/mtd/devices/slram.c
include/mtd/mtd-abi.h

index 9b7c49930a76f5bffb817a1af2b00cee39e5acd8..763925747db6f60a6701aad1b68e2fdecb801457 100644 (file)
@@ -64,7 +64,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
        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;
index d59ac01365108f1bc77c12c596d9d035a333027e..bc6ee9ef8a31ac8d6a44ef054d9d0a33d9dc9a23 100644 (file)
@@ -40,7 +40,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map)
        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;
index 1157182c2c8c6ce75399b483a244edded7232483..0d98c223c5fc2e188d1f1e58ad0ea53ca0d1a506 100644 (file)
@@ -324,7 +324,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
 
        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;
index a6466f923e7e9f6d4b4a2f3bc345d6473bd4f347..4ab7670770e43ff1cc9a0d855b872e1c22656f1e 100644 (file)
@@ -218,7 +218,7 @@ static int __init ms02nv_init_one(ulong addr)
        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;
index 8ab4b931215ffba1947cf18b092397e9e4a41284..b4438eacfd80d47c7dfc7e59146f9b806e8ae6e6 100644 (file)
@@ -103,7 +103,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
 
        /* 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;
index e6daa74d5fc641f3f53ff8dbd19576017c27d41b..e09e416667d38daea36e24b8034daa86597adb79 100644 (file)
@@ -149,7 +149,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
        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;
index aa9f6c993125a2f7d195275227d169cdf72b8fd0..666cce1bf60c0dddea6df065f47c89cd22330ef9 100644 (file)
@@ -775,7 +775,7 @@ static int __init init_pmc551(void)
                 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;
index fdb7a78b53045eec9308b3857a4af0b7b22794cc..b3f665e3c38bfeec5fade51e3c4fb77ee61bc7b4 100644 (file)
@@ -207,7 +207,7 @@ static int register_device(char *name, unsigned long start, unsigned long length
        (*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)) {
index 7ccadb1eaf7d77fc3779a3dead61ced7b52c4c70..ee2afbaefe1b7aaa9ed44a829cd1791144317e9c 100644 (file)
@@ -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 */