aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2006-03-14 00:20:40 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-14 10:57:17 -0500
commit3cb4f09fc2e98bbf26f8c900a94bf3910cd4d823 (patch)
tree3b0c652fedc40b673bf533f452dee83169655073 /drivers/mtd
parent3759fa9c55923f719ae944a3f8fbb029b36f759d (diff)
[PATCH] mtd_dataflash, fix block vs page erase
Fix a bug in the block-erase optimization for Dataflash; it was using block erase even for smaller segments that need page erase. That wouldn't matter for JFFS2, which never erases less than one block (sometimes several blocks), but for other callers it might. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: David Woodhouse <dwmw2@infradead.org> Acked-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/mtd_dataflash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 155737e7483f..a19480d07888 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -178,7 +178,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
178 * we're at a block boundary and need to erase the whole block. 178 * we're at a block boundary and need to erase the whole block.
179 */ 179 */
180 pageaddr = instr->addr / priv->page_size; 180 pageaddr = instr->addr / priv->page_size;
181 do_block = (pageaddr & 0x7) == 0 && instr->len <= blocksize; 181 do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize;
182 pageaddr = pageaddr << priv->page_offset; 182 pageaddr = pageaddr << priv->page_offset;
183 183
184 command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE; 184 command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;