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

login
register
mail settings
Submitter Jon Ringle
Date Jan. 13, 2010, 2:36 p.m.
Message ID <1263393370-3561-1-git-send-email-jon@ringle.org>
Download mbox | patch
Permalink /patch/42825/
State Accepted
Commit 53f2b1c86a1fa1414be93571062ac4c263fa9fbc
Headers show

Comments

Jon Ringle - Jan. 13, 2010, 2:36 p.m.
ixp4xx updates:
  - Fix handling of reads that don't start on a half-word boundary.


Signed-off-by: Jon Ringle <jon@ringle.org>
---
 drivers/mtd/maps/ixp4xx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Artem Bityutskiy - Jan. 28, 2010, 4:19 p.m.
On Wed, 2010-01-13 at 09:36 -0500, Jon Ringle wrote:
> ixp4xx updates:
>   - Fix handling of reads that don't start on a half-word boundary.
> 
> 
> Signed-off-by: Jon Ringle <jon@ringle.org>

I've pushed this patch to my l2-mtd-2.6.git/master tree

Patch

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