dect
/
linux-2.6
Archived
13
0
Fork 0

mtd: onenand:fix for page addr calculation based on device type

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>
This commit is contained in:
Rohit Hassan Sathyanarayan 2010-07-23 12:29:25 +05:30 committed by David Woodhouse
parent 02ed70bb7b
commit 42b0aab1cc
1 changed files with 5 additions and 2 deletions

View File

@ -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;