OneNAND: Add missing mtd info struct before calling onenand_erase()
authorStefan Roese <sr@denx.de>
Thu, 27 Nov 2008 13:11:37 +0000 (14:11 +0100)
committerScott Wood <scottwood@freescale.com>
Tue, 2 Dec 2008 19:48:15 +0000 (13:48 -0600)
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>
common/env_onenand.c

index 3c65b3e4873d3c7566fcc9b4b2a025a1e61ce08b..dbccc791258b7f0b054c5a26377387d2e0a14a9c 100644 (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;