Merge tag 'u-boot-atmel-fixes-2021.01-b' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git] / env / mmc.c
index aca61b7..ee376c3 100644 (file)
--- a/env/mmc.c
+++ b/env/mmc.c
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_SYS_MMC_ENV_DEV)
-#define CONFIG_SYS_MMC_ENV_DEV 0
-#endif
-
-__weak int mmc_get_env_dev(void)
-{
-       return CONFIG_SYS_MMC_ENV_DEV;
-}
-
 #if CONFIG_IS_ENABLED(OF_CONTROL)
 static inline int mmc_offset_try_partition(const char *str, int copy, s64 *val)
 {
@@ -51,7 +42,7 @@ static inline int mmc_offset_try_partition(const char *str, int copy, s64 *val)
                if (ret < 0)
                        return ret;
 
-               if (!strncmp((const char *)info.name, str, sizeof(str)))
+               if (!strncmp((const char *)info.name, str, sizeof(info.name)))
                        break;
        }
 
@@ -338,7 +329,7 @@ static int env_mmc_load(void)
        read2_fail = read_env(mmc, CONFIG_ENV_SIZE, offset2, tmp_env2);
 
        ret = env_import_redund((char *)tmp_env1, read1_fail, (char *)tmp_env2,
-                               read2_fail);
+                               read2_fail, H_EXTERNAL);
 
 fini:
        fini_mmc_for_env(mmc);
@@ -380,7 +371,7 @@ static int env_mmc_load(void)
                goto fini;
        }
 
-       ret = env_import(buf, 1);
+       ret = env_import(buf, 1, H_EXTERNAL);
        if (!ret) {
                ep = (env_t *)buf;
                gd->env_addr = (ulong)&ep->data;