From: Sanjeev Premi Date: Fri, 18 Dec 2009 09:25:24 +0000 (+0530) Subject: onenand: Fix compile errors due to FlexOneNAND X-Git-Tag: v2010.03-rc1~158^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b821cead7d2147724d5f1d8ccbca40710faad38a;p=u-boot onenand: Fix compile errors due to FlexOneNAND This patch fixes the compile error while trying to compile for omap3evm. env_onenand.c: In function 'env_relocate_spec': env_onenand.c:70: error: 'CONFIG_ENV_ADDR_FLEX' undeclared (first use in this function) env_onenand.c:70: error: (Each undeclared identifier is re ported only once env_onenand.c:70: error: for each function it appears in.) env_onenand.c: In function 'saveenv': env_onenand.c:106: error: 'CONFIG_ENV_ADDR_FLEX' undeclare d (first use in this function) env_onenand.c:107: error: 'CONFIG_ENV_SIZE_FLEX' undeclare d (first use in this function) Signed-off-by: Sanjeev Premi Acked-by: Tom Rix --- diff --git a/common/env_onenand.c b/common/env_onenand.c index 23d2caa621..cf997bf7e5 100644 --- a/common/env_onenand.c +++ b/common/env_onenand.c @@ -60,15 +60,18 @@ uchar env_get_char_spec(int index) void env_relocate_spec(void) { struct mtd_info *mtd = &onenand_mtd; +#ifdef CONFIG_ENV_ADDR_FLEX struct onenand_chip *this = &onenand_chip; +#endif loff_t env_addr; int use_default = 0; size_t retlen; env_addr = CONFIG_ENV_ADDR; +#ifdef CONFIG_ENV_ADDR_FLEX if (FLEXONENAND(this)) env_addr = CONFIG_ENV_ADDR_FLEX; - +#endif /* Check OneNAND exist */ if (mtd->writesize) /* Ignore read fail */ @@ -94,7 +97,9 @@ void env_relocate_spec(void) int saveenv(void) { struct mtd_info *mtd = &onenand_mtd; +#ifdef CONFIG_ENV_ADDR_FLEX struct onenand_chip *this = &onenand_chip; +#endif loff_t env_addr = CONFIG_ENV_ADDR; struct erase_info instr = { .callback = NULL, @@ -102,12 +107,14 @@ int saveenv(void) size_t retlen; instr.len = CONFIG_ENV_SIZE; +#ifdef CONFIG_ENV_ADDR_FLEX if (FLEXONENAND(this)) { env_addr = CONFIG_ENV_ADDR_FLEX; instr.len = CONFIG_ENV_SIZE_FLEX; instr.len <<= onenand_mtd.eraseregions[0].numblocks == 1 ? 1 : 0; } +#endif instr.addr = env_addr; instr.mtd = mtd; if (mtd->erase(mtd, &instr)) {