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.

Signed-off-by: Stefan Roese <sr@denx.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
This commit is contained in:
Stefan Roese 2008-11-27 14:11:37 +01:00 committed by Scott Wood
parent 2077e348c2
commit 5e46b1e541
1 changed files with 1 additions and 0 deletions

View File

@ -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;