summaryrefslogtreecommitdiff
path: root/common/cmd_nvedit.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2008-12-30 02:59:25 -0500
committerWolfgang Denk <wd@denx.de>2009-01-27 22:30:42 +0100
commitba69dc26a5fd606da49573bb2f15e756a34f3f98 (patch)
treed961b92bc17317e17b5a115db74e4a38727f4dab /common/cmd_nvedit.c
parent2ac6985a7466a1c8a7aa8b2fa24d360925a82764 (diff)
saveenv: standardize enablement
Rather than special casing each environment type for enabling the saveenv command, have them all behave the same. This avoids bitrot as new env sources are added/removed. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r--common/cmd_nvedit.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 85025daec7..b93de13d08 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -546,11 +546,8 @@ int getenv_r (char *name, char *buf, unsigned len)
return (-1);
}
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
+#if defined(CONFIG_CMD_ENV) && !defined(CONFIG_ENV_IS_NOWHERE)
+
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
extern char * env_name_spec;
@@ -560,6 +557,12 @@ int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return (saveenv() ? 1 : 0);
}
+U_BOOT_CMD(
+ saveenv, 1, 0, do_saveenv,
+ "saveenv - save environment variables to persistent storage\n",
+ NULL
+);
+
#endif
@@ -602,19 +605,6 @@ U_BOOT_CMD(
" - delete environment variable 'name'\n"
);
-#if ((defined(CONFIG_ENV_IS_IN_NVRAM) || defined(CONFIG_ENV_IS_IN_EEPROM) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_FLASH)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_NAND)) \
- || (defined(CONFIG_CMD_ENV) && defined(CONFIG_CMD_ONENAND))) \
- && !defined(CONFIG_ENV_IS_NOWHERE))
-U_BOOT_CMD(
- saveenv, 1, 0, do_saveenv,
- "saveenv - save environment variables to persistent storage\n",
- NULL
-);
-
-#endif
-
#if defined(CONFIG_CMD_ASKENV)
U_BOOT_CMD(