X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=env%2Ffat.c;h=7f74c64dfe7e094af8142cb66dc94682dabc6b5a;hb=4f0b061444063d7c60e9624c5431c16f00d067af;hp=e6bd1f915dc616aeaeee3016fef1c424da59baeb;hpb=cda87ec5587261cc813b404f713b102afede0800;p=oweals%2Fu-boot.git diff --git a/env/fat.c b/env/fat.c index e6bd1f915d..7f74c64dfe 100644 --- a/env/fat.c +++ b/env/fat.c @@ -1,10 +1,9 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * (c) Copyright 2011 by Tigris Elektronik GmbH * * Author: * Maximilian Schwerin - * - * SPDX-License-Identifier: GPL-2.0+ */ #include @@ -31,8 +30,6 @@ # endif #endif -DECLARE_GLOBAL_DATA_PTR; - #ifdef CMD_SAVEENV static int env_fat_save(void) { @@ -89,6 +86,11 @@ static int env_fat_load(void) int dev, part; int err; +#ifdef CONFIG_MMC + if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc")) + mmc_initialize(NULL); +#endif + part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE, CONFIG_ENV_FAT_DEVICE_AND_PART, &dev_desc, &info, 1); @@ -120,7 +122,7 @@ static int env_fat_load(void) return env_import(buf, 1); err_env_relocate: - set_default_env(NULL); + set_default_env(NULL, 0); return -EIO; }