diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-12-11 22:16:37 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-13 11:46:57 -0700 |
commit | 1d6cd0a3f69b549a3fc7e735a045279e7a14947e (patch) | |
tree | 4abb7a50269c09b33e599f291bf6295b863e28e0 /tools/env/fw_env.c | |
parent | 9d8d661d7fda6ccda1d5fc31565f207b7648bc6d (diff) | |
download | u-boot-imx-1d6cd0a3f69b549a3fc7e735a045279e7a14947e.zip u-boot-imx-1d6cd0a3f69b549a3fc7e735a045279e7a14947e.tar.gz u-boot-imx-1d6cd0a3f69b549a3fc7e735a045279e7a14947e.tar.bz2 |
env: Handle write-once ethaddr and serial# generically
Use the variable access flags to implement the protection for ethaddr
and serial# instead of hard-coding them.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'tools/env/fw_env.c')
-rw-r--r-- | tools/env/fw_env.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index a596a1b..90c7a5d 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -369,23 +369,6 @@ int fw_env_write(char *name, char *value) return 0; if (deleting || overwriting) { -#ifndef CONFIG_ENV_OVERWRITE - /* - * Ethernet Address and serial# can be set only once - */ - if ( - (strcmp(name, "serial#") == 0) || - ((strcmp(name, "ethaddr") == 0) -#if defined(CONFIG_OVERWRITE_ETHADDR_ONCE) && defined(CONFIG_ETHADDR) - && (strcmp(oldval, __stringify(CONFIG_ETHADDR)) != 0) -#endif /* CONFIG_OVERWRITE_ETHADDR_ONCE && CONFIG_ETHADDR */ - ) ) { - fprintf (stderr, "Can't overwrite \"%s\"\n", name); - errno = EROFS; - return -1; - } -#endif /* CONFIG_ENV_OVERWRITE */ - if (*++nxt == '\0') { *env = '\0'; } else { |