X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=env%2Fext4.c;h=09c5e4a491018a35adaf1fba3294b3778f9d70e6;hb=54468f5853bb61a5e836a063f9aecc0469ba9033;hp=9cdf28e79f1a56399e2ca8f0982a4993a4ffc4cc;hpb=fdb6c3232f66bc9c07c30de87928506477ac4e63;p=oweals%2Fu-boot.git diff --git a/env/ext4.c b/env/ext4.c index 9cdf28e79f..09c5e4a491 100644 --- a/env/ext4.c +++ b/env/ext4.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (c) Copyright 2016 by VRT Technology * @@ -15,8 +16,6 @@ * EXT4 filesystem implementation in Uboot by * Uma Shankar * Manjunatha C Achar - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -31,8 +30,6 @@ #include #include -DECLARE_GLOBAL_DATA_PTR; - #ifdef CONFIG_CMD_SAVEENV static int env_ext4_save(void) { @@ -87,6 +84,11 @@ static int env_ext4_load(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); @@ -114,11 +116,10 @@ static int env_ext4_load(void) goto err_env_relocate; } - env_import(buf, 1); - return 0; + return env_import(buf, 1); err_env_relocate: - set_default_env(NULL); + set_default_env(NULL, 0); return -EIO; }