Messages in this thread Patch in this message | ![/](/images/icornerl.gif) | | Date | Thu, 13 Apr 2006 18:53:14 +0200 | From | Jörn Engel <> | Subject | [PATCH 1/4] Simplify test for RAM devices |
| |
mtdblock is the only user of aggregate capabilities in mtd. This is clearly bogus and should be changed. In particular, it tries to determine whether the device in question is a piece of RAM. For every single driver that fits the current criteria, an easier test would be to check for the type being MTD_RAM.
Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de> ---
drivers/mtd/mtdblock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
--- mtd_type/drivers/mtd/mtdblock.c~mtdblock_ram_test 2006-04-13 18:03:41.000000000 +0200 +++ mtd_type/drivers/mtd/mtdblock.c 2006-04-13 18:19:19.000000000 +0200 @@ -288,8 +288,7 @@ static int mtdblock_open(struct mtd_blkt mutex_init(&mtdblk->cache_mutex); mtdblk->cache_state = STATE_EMPTY; - if ((mtdblk->mtd->flags & MTD_CAP_RAM) != MTD_CAP_RAM && - mtdblk->mtd->erasesize) { + if (mtdblk->mtd->type != MTD_RAM && mtdblk->mtd->erasesize) { mtdblk->cache_size = mtdblk->mtd->erasesize; mtdblk->cache_data = NULL; } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |