]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/env_nvram.c
Merge branch 'master' of git://www.denx.de/git/u-boot-mpc85xx
[karo-tx-uboot.git] / common / env_nvram.c
index 2c831d14d774b63a3609dfab8a9c466cfe2055f9..7c18896cb04fa88b42ec92275547eacfa1d18406 100644 (file)
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */
 
 #include <command.h>
 #include <environment.h>
 #include <linux/stddef.h>
-#include <malloc.h>
 
 #ifdef CFG_NVRAM_ACCESS_ROUTINE
 extern void *nvram_read(void *dest, const long src, size_t count);
@@ -75,7 +76,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
        uchar retval;
        enable_nvram();
        retval = *((uchar *)(gd->env_addr + index));
@@ -93,8 +93,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
-
        return *((uchar *)(gd->env_addr + index));
 #endif
 }
@@ -136,7 +134,6 @@ int saveenv (void)
  */
 int env_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_AMIGAONEG3SE
        enable_nvram();
 #endif