onenand: Fix compile errors due to FlexOneNAND
PATCH 1/1 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)
--- common/env_onenand.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
common/env_onenand.c +4 -1
@@ -66,9 +66,10 @@ void env_relocate_spec(void)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 */
@@ -102,12 +103,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)) {
Signature · 1 line
1.6.2.2
PATCH 1/1 onenand: Fix compile errors due to FlexOneNAND
Quoted 3 lines · Sanjeev Premi
This patch fixes the compile error while trying to compile for omap3evm.
<snip>
common/env_onenand.c void env_relocate_spec(void) · line 72
Quoted 8 lines
env_onenand.c: In function 'env_relocate_spec':common/env_onenand.c +2
-1env_addr =CONFIG_ENV_ADDR ; +#ifdef CONFIG_ENV_ADDR_FLEX if (FLEXONENAND (this)) env_addr =CONFIG_ENV_ADDR_FLEX ; - +#endif
Please also add this #ifdef around the declaration of
struct onenand_chip *this = &onenand_chip;
There are 'unused variable' warnings now
Otherwise fine.
Tom