dfu: dfu_sf: Fix read offset
authorPhil Edworthy <phil.edworthy@renesas.com>
Wed, 24 May 2017 14:09:49 +0000 (15:09 +0100)
committerLukasz Majewski <lukma@denx.de>
Sat, 3 Jun 2017 17:08:31 +0000 (19:08 +0200)
The offset was applied to write, but not read, now its applied to
both.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
drivers/dfu/dfu_sf.c

index 9702eeea202a97f87b9c24b152e335d792b4f49b..b6d5fe24dc82e56620460185c875243bb0c8ef63 100644 (file)
@@ -20,7 +20,8 @@ static long dfu_get_medium_size_sf(struct dfu_entity *dfu)
 static int dfu_read_medium_sf(struct dfu_entity *dfu, u64 offset, void *buf,
                long *len)
 {
-       return spi_flash_read(dfu->data.sf.dev, offset, *len, buf);
+       return spi_flash_read(dfu->data.sf.dev, dfu->data.sf.start + offset,
+               *len, buf);
 }
 
 static u64 find_sector(struct dfu_entity *dfu, u64 start, u64 offset)