]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
sf: Compute the dual parallel write chunk_len based on offset
authorJagannadha Sutradharudu Teki <jagannadha.sutradharudu-teki@xilinx.com>
Fri, 14 Jun 2013 08:52:16 +0000 (14:22 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 14 Jun 2013 11:29:13 +0000 (13:29 +0200)
chunk_len in should be interms of page_size, as page_size
is double in dual parallel chunk_len must be computed based
on the offset not with write_addr.

Signed-off-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/spi/spi_flash.c

index 0e0c3fe632f0a06eb3e995b808cfaf81eb46d5d5..6cf4d93153622a9b46171c1e2b0ebf5486c78eb1 100644 (file)
@@ -114,7 +114,7 @@ int spi_flash_cmd_write_multi(struct spi_flash *flash, u32 offset,
                        return ret;
                }
 
-               byte_addr = write_addr % page_size;
+               byte_addr = offset % page_size;
 
                chunk_len = min(len - actual, page_size - byte_addr);