]> 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 a406e427a24e871f9ace82901483b434afd58272..7c18896cb04fa88b42ec92275547eacfa1d18406 100644 (file)
@@ -42,6 +42,8 @@
 
 #include <common.h>
 
+DECLARE_GLOBAL_DATA_PTR;
+
 #ifdef CFG_ENV_IS_IN_NVRAM /* Environment is in NVRAM */
 
 #include <command.h>
@@ -74,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));
@@ -92,8 +93,6 @@ uchar env_get_char_spec (int index)
 
        return c;
 #else
-       DECLARE_GLOBAL_DATA_PTR;
-
        return *((uchar *)(gd->env_addr + index));
 #endif
 }
@@ -135,7 +134,6 @@ int saveenv (void)
  */
 int env_init (void)
 {
-       DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_AMIGAONEG3SE
        enable_nvram();
 #endif