Skip to contentSkip to conversation

sf: fix stmicro offset setup while erasing

PATCH New Mike Frysinger 2 participants 2 messages Oct 14, 2009 – Nov 22, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sf: fix stmicro offset setup while erasing

---
 drivers/mtd/spi/stmicro.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/spi/stmicro.c +2 -1
index 9b910c1..ae0d047 100644
@@ -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) {
Signature · 1 line
1.6.5
#1 lore raw

PATCH 1/1 sf: fix stmicro offset setup while erasing

Dear Mike Frysinger,

Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/mtd/spi/stmicro.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never underestimate the power of human stupidity  when  it  comes  to
using technology they don't understand.