Skip to content

Commit

Permalink
mtd: onenand:fix for page addr calculation based on device type
Browse files Browse the repository at this point in the history
Sending the patch for page address calculation based on device type. This resolves the
OneNAND DDP device read problem as pointed by Enric.
http://lists.infradead.org/pipermail/linux-mtd/2010-July/030920.html

Signed-off-by: Rohit HS <rohit.hs@samsung.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Rohit Hassan Sathyanarayan authored and David Woodhouse committed Aug 2, 2010
1 parent 02ed70b commit 42b0aab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,11 @@ static int onenand_command(struct mtd_info *mtd, int cmd, loff_t addr, size_t le

default:
block = onenand_block(this, addr);
page = (int) (addr - onenand_addr(this, block)) >> this->page_shift;

if (FLEXONENAND(this))
page = (int) (addr - onenand_addr(this, block))>>\
this->page_shift;
else
page = (int) (addr >> this->page_shift);
if (ONENAND_IS_2PLANE(this)) {
/* Make the even block number */
block &= ~1;
Expand Down

0 comments on commit 42b0aab

Please sign in to comment.