mtd: ixp4xx: fix reading from half-word boundary
authorJon Ringle <jon@ringle.org>
Wed, 13 Jan 2010 14:36:10 +0000 (09:36 -0500)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 25 Feb 2010 11:28:56 +0000 (11:28 +0000)
Fix handling of reads that don't start on a half-word boundary.

Signed-off-by: Jon Ringle <jon@ringle.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/maps/ixp4xx.c

index 7b05152..7513d90 100644 (file)
@@ -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;
        }