|
@@ -178,7 +178,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
|
|
|
/* Calculate flash page address; use block erase (for speed) if
|
|
|
* we're at a block boundary and need to erase the whole block.
|
|
|
*/
|
|
|
- pageaddr = div_u64(instr->len, priv->page_size);
|
|
|
+ pageaddr = div_u64(instr->addr, priv->page_size);
|
|
|
do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize;
|
|
|
pageaddr = pageaddr << priv->page_offset;
|
|
|
|