+// SPDX-License-Identifier: GPL-2.0+
/*
* (c) Copyright 2016 by VRT Technology
*
* EXT4 filesystem implementation in Uboot by
* Uma Shankar <uma.shankar@samsung.com>
* Manjunatha C Achar <a.manjunatha@samsung.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <ext4fs.h>
#include <mmc.h>
-DECLARE_GLOBAL_DATA_PTR;
-
#ifdef CONFIG_CMD_SAVEENV
static int env_ext4_save(void)
{
int err;
loff_t off;
+#ifdef CONFIG_MMC
+ if (!strcmp(CONFIG_ENV_EXT4_INTERFACE, "mmc"))
+ mmc_initialize(NULL);
+#endif
+
part = blk_get_device_part_str(CONFIG_ENV_EXT4_INTERFACE,
CONFIG_ENV_EXT4_DEVICE_AND_PART,
&dev_desc, &info, 1);
goto err_env_relocate;
}
- env_import(buf, 1);
- return 0;
+ return env_import(buf, 1);
err_env_relocate:
set_default_env(NULL);