]> git.sur5r.net Git - u-boot/blobdiff - env/fat.c
Merge git://git.denx.de/u-boot-sunxi
[u-boot] / env / fat.c
index 158a9a34357bb8eb791ac3372c977d9a0d2b698e..19f260e881ac3e77f5d04e69aeb261691f780388 100644 (file)
--- a/env/fat.c
+++ b/env/fat.c
@@ -36,7 +36,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CMD_SAVEENV
 static int env_fat_save(void)
 {
-       env_t   env_new;
+       env_t __aligned(ARCH_DMA_MINALIGN) env_new;
        struct blk_desc *dev_desc = NULL;
        disk_partition_t info;
        int dev, part;
@@ -89,6 +89,9 @@ static int env_fat_load(void)
        int dev, part;
        int err;
 
+       if (!strcmp(CONFIG_ENV_FAT_INTERFACE, "mmc"))
+               mmc_initialize(NULL);
+
        part = blk_get_device_part_str(CONFIG_ENV_FAT_INTERFACE,
                                        CONFIG_ENV_FAT_DEVICE_AND_PART,
                                        &dev_desc, &info, 1);
@@ -117,8 +120,7 @@ static int env_fat_load(void)
                goto err_env_relocate;
        }
 
-       env_import(buf, 1);
-       return 0;
+       return env_import(buf, 1);
 
 err_env_relocate:
        set_default_env(NULL);