struct nand_env_location {
const char *name;
- const nand_erase_options_t erase_opts;
+ nand_erase_options_t erase_opts;
};
static int erase_and_write_env(const struct nand_env_location *location,
int ret = 0;
ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
int env_idx = 0;
- static const struct nand_env_location location[] = {
- {
- .name = "NAND",
- .erase_opts = {
- .length = CONFIG_ENV_RANGE,
- .offset = env_get_offset(CONFIG_ENV_OFFSET),
- },
- },
+ static struct nand_env_location location[2] = {0};
+
+ location[0].name = "NAND";
+ location[0].erase_opts.length = CONFIG_ENV_RANGE;
+ location[0].erase_opts.offset = env_get_offset(CONFIG_ENV_OFFSET);
+
#ifdef CONFIG_ENV_OFFSET_REDUND
- {
- .name = "redundant NAND",
- .erase_opts = {
- .length = CONFIG_ENV_RANGE,
- .offset = CONFIG_ENV_OFFSET_REDUND,
- },
- },
+ location[1].name = "redundant NAND";
+ location[1].erase_opts.length = CONFIG_ENV_RANGE;
+ location[1].erase_opts.offset = CONFIG_ENV_OFFSET_REDUND;
#endif
- };
-
if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
return 1;