Skip to content

Commit

Permalink
Simplify test for RAM devices
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Jörn Engel authored and David Woodhouse committed Apr 17, 2006
1 parent 94171db commit 7f7c08d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/mtd/mtdblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ static int mtdblock_open(struct mtd_blktrans_dev *mbd)

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;
}
Expand Down

0 comments on commit 7f7c08d

Please sign in to comment.