projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
spl: spl_legacy: Use IS_ENABLED() to remove #ifdef
[oweals/u-boot.git]
/
env
/
fat.c
diff --git
a/env/fat.c
b/env/fat.c
index e6bd1f915dc616aeaeee3016fef1c424da59baeb..cf2e5e2b26e90b1f05bcf70a98c7d70cdaff6edf 100644
(file)
--- a/
env/fat.c
+++ b/
env/fat.c
@@
-1,16
+1,16
@@
+// SPDX-License-Identifier: GPL-2.0+
/*
* (c) Copyright 2011 by Tigris Elektronik GmbH
*
* Author:
* Maximilian Schwerin <mvs@tigris.de>
/*
* (c) Copyright 2011 by Tigris Elektronik GmbH
*
* Author:
* Maximilian Schwerin <mvs@tigris.de>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <command.h>
*/
#include <common.h>
#include <command.h>
-#include <environment.h>
+#include <env.h>
+#include <env_internal.h>
#include <linux/stddef.h>
#include <malloc.h>
#include <memalign.h>
#include <linux/stddef.h>
#include <malloc.h>
#include <memalign.h>
@@
-26,14
+26,8
@@
# endif
#else
# define LOADENV
# endif
#else
# define LOADENV
-# if defined(CONFIG_CMD_SAVEENV)
-# define CMD_SAVEENV
-# endif
#endif
#endif
-DECLARE_GLOBAL_DATA_PTR;
-
-#ifdef CMD_SAVEENV
static int env_fat_save(void)
{
env_t __aligned(ARCH_DMA_MINALIGN) env_new;
static int env_fat_save(void)
{
env_t __aligned(ARCH_DMA_MINALIGN) env_new;
@@
-78,7
+72,6
@@
static int env_fat_save(void)
return 0;
}
return 0;
}
-#endif /* CMD_SAVEENV */
#ifdef LOADENV
static int env_fat_load(void)
#ifdef LOADENV
static int env_fat_load(void)
@@
-89,6
+82,11
@@
static int env_fat_load(void)
int dev, part;
int err;
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);
part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
CONFIG_ENV_FAT_DEVICE_AND_PART,
&dev_desc, &info, 1);
@@
-120,7
+118,7
@@
static int env_fat_load(void)
return env_import(buf, 1);
err_env_relocate:
return env_import(buf, 1);
err_env_relocate:
-
set_default_env(NULL
);
+
env_set_default(NULL, 0
);
return -EIO;
}
return -EIO;
}
@@
-132,7
+130,5
@@
U_BOOT_ENV_LOCATION(fat) = {
#ifdef LOADENV
.load = env_fat_load,
#endif
#ifdef LOADENV
.load = env_fat_load,
#endif
-#ifdef CMD_SAVEENV
- .save = env_save_ptr(env_fat_save),
-#endif
+ .save = ENV_SAVE_PTR(env_fat_save),
};
};