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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Aug 4 06:59:06 EDT 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=42b0aab1cc30b2fa7e0a99b832bd1b5c9b59757d
Commit:     42b0aab1cc30b2fa7e0a99b832bd1b5c9b59757d
Parent:     02ed70bb7b2644936959aee617296022dedb109e
Author:     Rohit Hassan Sathyanarayan <rohit.hs at samsung.com>
AuthorDate: Fri Jul 23 12:29:25 2010 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Aug 2 09:10:09 2010 +0100

    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 at samsung.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/onenand/onenand_base.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 26caf25..f749935 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
 
 	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;



More information about the linux-mtd-cvs mailing list