Skip to contentSkip to conversation

OneNAND: Add missing mtd info struct before calling onenand_erase()

PATCH New Stefan Roese 2 participants 2 messages Nov 27, 2008 – Dec 2, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OneNAND: Add missing mtd info struct before calling onenand_erase()

Without this patch "saveenv" crashes when MTD partitions are enabled (e.g. for use in UBI) via CONFIG_MTD_PARTITIONS.

---
 common/env_onenand.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
common/env_onenand.c +1 -0
index 3c65b3e..dbccc79 100644
@@ -97,6 +97,7 @@ int saveenv(void)
 
 	instr.len = CONFIG_ENV_SIZE;
 	instr.addr = env_addr;
+	instr.mtd = &onenand_mtd;
 	if (onenand_erase(&onenand_mtd, &instr)) {
 		printf("OneNAND: erase failed at 0x%08lx\n", env_addr);
 		return 1;
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 OneNAND: Add missing mtd info struct before calling onenand_erase()

Quoted 4 lines · Stefan Roese

Without this patch "saveenv" crashes when MTD partitions are enabled (e.g. for use in UBI) via CONFIG_MTD_PARTITIONS.

Applied to u-boot-nand-flash

-Scott