diff options
author | Igor Grinberg <grinberg@compulab.co.il> | 2011-12-26 07:33:10 +0400 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-01-05 19:34:10 +0400 |
commit | bf95df44ff69e3e365603e3e30664ec41bfe0c65 (patch) | |
tree | d6727b154fb2e17279acb141cd2975f60b243f10 /common/env_nvram.c | |
parent | 33e1e01820f9a1e19ab18c8791f3b2dc09165e2b (diff) | |
download | u-boot-bf95df44ff69e3e365603e3e30664ec41bfe0c65.tar.xz |
env: factor out the env_get_char_spec() function
env_get_char_spec() function is duplicated across multiple environment
files.
Remove the duplication by providing a default implementation.
Add "weak" declaration, so the default implementation can be overridden.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Diffstat (limited to 'common/env_nvram.c')
-rw-r--r-- | common/env_nvram.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/common/env_nvram.c b/common/env_nvram.c index 726eaac55e..6483db39d3 100644 --- a/common/env_nvram.c +++ b/common/env_nvram.c @@ -59,18 +59,16 @@ env_t *env_ptr = (env_t *)CONFIG_ENV_ADDR; char *env_name_spec = "NVRAM"; +#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE uchar env_get_char_spec(int index) { -#ifdef CONFIG_SYS_NVRAM_ACCESS_ROUTINE uchar c; nvram_read(&c, CONFIG_ENV_ADDR + index, 1); return c; -#else - return *((uchar *)(gd->env_addr + index)); -#endif } +#endif void env_relocate_spec(void) { |