Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92cbfdcc authored by Joern Engel's avatar Joern Engel
Browse files

[MTD] replace MTD_RAM with MTD_GENERIC_TYPE



Ram devices get the extra capability of MTD_NO_ERASE - not requiring
an explicit erase before writing to it.  Currently only mtdblock uses
this capability.  Rest of the patch is a simple text replacement.

Signed-off-by: default avatarJoern Engel <joern@wh.fh-wedel.de>
parent e369d62e
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -64,7 +64,7 @@ static struct mtd_info *map_ram_probe(struct map_info *map)
	map->fldrv = &mapram_chipdrv;
	map->fldrv = &mapram_chipdrv;
	mtd->priv = map;
	mtd->priv = map;
	mtd->name = map->name;
	mtd->name = map->name;
	mtd->type = MTD_RAM;
	mtd->type = MTD_GENERIC_TYPE;
	mtd->size = map->size;
	mtd->size = map->size;
	mtd->erase = mapram_erase;
	mtd->erase = mapram_erase;
	mtd->read = mapram_read;
	mtd->read = mapram_read;
+1 −1
Original line number Original line Diff line number Diff line
@@ -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.size = dev->blkdev->bd_inode->i_size & PAGE_MASK;
	dev->mtd.erasesize = erase_size;
	dev->mtd.erasesize = erase_size;
	dev->mtd.type = MTD_RAM;
	dev->mtd.type = MTD_GENERIC_TYPE;
	dev->mtd.flags = MTD_CAP_RAM;
	dev->mtd.flags = MTD_CAP_RAM;
	dev->mtd.erase = block2mtd_erase;
	dev->mtd.erase = block2mtd_erase;
	dev->mtd.write = block2mtd_write;
	dev->mtd.write = block2mtd_write;
+1 −1
Original line number Original line Diff line number Diff line
@@ -218,7 +218,7 @@ static int __init ms02nv_init_one(ulong addr)
	fixsize = (size - (fixaddr - addr)) & ~(PAGE_SIZE - 1);
	fixsize = (size - (fixaddr - addr)) & ~(PAGE_SIZE - 1);
	mp->uaddr = phys_to_virt(fixaddr);
	mp->uaddr = phys_to_virt(fixaddr);


	mtd->type = MTD_RAM;
	mtd->type = MTD_GENERIC_TYPE;
	mtd->flags = MTD_CAP_RAM;
	mtd->flags = MTD_CAP_RAM;
	mtd->size = fixsize;
	mtd->size = fixsize;
	mtd->name = (char *)ms02nv_name;
	mtd->name = (char *)ms02nv_name;
+1 −1
Original line number Original line Diff line number Diff line
@@ -103,7 +103,7 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,


	/* Setup the MTD structure */
	/* Setup the MTD structure */
	mtd->name = name;
	mtd->name = name;
	mtd->type = MTD_RAM;
	mtd->type = MTD_GENERIC_TYPE;
	mtd->flags = MTD_CAP_RAM;
	mtd->flags = MTD_CAP_RAM;
	mtd->size = size;
	mtd->size = size;
	mtd->erasesize = MTDRAM_ERASE_SIZE;
	mtd->erasesize = MTDRAM_ERASE_SIZE;
+1 −1
Original line number Original line Diff line number Diff line
@@ -149,7 +149,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
	new->mtd.read = phram_read;
	new->mtd.read = phram_read;
	new->mtd.write = phram_write;
	new->mtd.write = phram_write;
	new->mtd.owner = THIS_MODULE;
	new->mtd.owner = THIS_MODULE;
	new->mtd.type = MTD_RAM;
	new->mtd.type = MTD_GENERIC_TYPE;
	new->mtd.erasesize = PAGE_SIZE;
	new->mtd.erasesize = PAGE_SIZE;


	ret = -EAGAIN;
	ret = -EAGAIN;
Loading