aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/onenand/onenand_base.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 26caf2590dae..f749935f3cb5 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -377,8 +377,11 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le
377 377
378 default: 378 default:
379 block = onenand_block(this, addr); 379 block = onenand_block(this, addr);
380 page = (int) (addr - onenand_addr(this, block)) >> this->page_shift; 380 if (FLEXONENAND(this))
381 381 page = (int) (addr - onenand_addr(this, block))>>\
382 this->page_shift;
383 else
384 page = (int) (addr >> this->page_shift);
382 if (ONENAND_IS_2PLANE(this)) { 385 if (ONENAND_IS_2PLANE(this)) {
383 /* Make the even block number */ 386 /* Make the even block number */
384 block &= ~1; 387 block &= ~1;