[PATCH] [MTD] maps/ixp4xx: Fix reading from half-word boundary

Jon Ringle jon at ringle.org
Wed Jan 13 09:36:10 EST 2010


ixp4xx updates:
  - Fix handling of reads that don't start on a half-word boundary.


Signed-off-by: Jon Ringle <jon at ringle.org>
---
 drivers/mtd/maps/ixp4xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/ixp4xx.c b/drivers/mtd/maps/ixp4xx.c
index 7214b87..6b540a5 100644
--- a/drivers/mtd/maps/ixp4xx.c
+++ b/drivers/mtd/maps/ixp4xx.c
@@ -107,8 +107,8 @@ static void ixp4xx_copy_from(struct map_info *map, void *to,
 		return;
 
 	if (from & 1) {
-		*dest++ = BYTE1(flash_read16(src));
-                src++;
+		*dest++ = BYTE1(flash_read16(src-1));
+		src++;
 		--len;
 	}
 
-- 
1.6.5.rc2




More information about the linux-mtd mailing list