From: Mike Frysinger Date: Wed, 14 Oct 2009 23:28:03 +0000 (-0400) Subject: sf: fix stmicro offset setup while erasing X-Git-Tag: v2009.11-rc2~49 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fcffb680e77fcb48598d4a9944dbe2d4503170e0;p=oweals%2Fu-boot.git sf: fix stmicro offset setup while erasing Reported-by: Peter Gombos Signed-off-by: Mike Frysinger --- diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c index 9b910c13fd..ae0d0471f2 100644 --- a/drivers/mtd/spi/stmicro.c +++ b/drivers/mtd/spi/stmicro.c @@ -281,7 +281,8 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len) ret = 0; for (actual = 0; actual < len; actual++) { - cmd[1] = (offset / sector_size) + actual; + cmd[1] = offset >> 16; + offset += sector_size; ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0); if (ret < 0) {