Merge with git://www.denx.de/git/u-boot.git
[platform/kernel/u-boot.git] / common / env_nvram.c
index 76e8438..7c18896 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 <cmd_nvedit.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);
@@ -76,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));
@@ -94,8 +93,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
-
        return *((uchar *)(gd->env_addr + index));
 #endif
 }
@@ -137,7 +134,6 @@ int saveenv (void)
  */
 int env_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_AMIGAONEG3SE
        enable_nvram();
 #endif