#include <ext4fs.h>
#include <mmc.h>
-char *env_name_spec = "EXT4";
-
-env_t *env_ptr;
-
DECLARE_GLOBAL_DATA_PTR;
-int env_init(void)
-{
- /* use default */
- gd->env_addr = (ulong)&default_environment[0];
- gd->env_valid = ENV_VALID;
-
- return 0;
-}
-
#ifdef CONFIG_CMD_SAVEENV
-int saveenv(void)
+static int env_ext4_save(void)
{
env_t env_new;
struct blk_desc *dev_desc = NULL;
}
#endif /* CONFIG_CMD_SAVEENV */
-void env_relocate_spec(void)
+static int env_ext4_load(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
struct blk_desc *dev_desc = NULL;
}
env_import(buf, 1);
- return;
+ return 0;
err_env_relocate:
set_default_env(NULL);
+
+ return -EIO;
}
U_BOOT_ENV_LOCATION(ext4) = {
.location = ENVL_EXT4,
- .get_char = env_get_char_spec,
- .load = env_relocate_spec,
- .save = env_save_ptr(saveenv),
- .init = env_init,
+ ENV_NAME("EXT4")
+ .load = env_ext4_load,
+ .save = env_save_ptr(env_ext4_save),
};