summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rw-r--r--env/mtd.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c31bf7ecea9..b03f87a93fb 100644
--- a/Makefile
+++ b/Makefile
@@ -2131,6 +2131,11 @@ $(filter-out tools, $(u-boot-dirs)): tools
# is "yes"), so compile examples after U-Boot is compiled.
examples: $(filter-out examples, $(u-boot-dirs))
+ifeq ($(CONFIG_USE_PRIVATE_LIBGCC),y)
+# lib/efi_loader apps depend on arch/$(ARCH)/lib for lib.a
+lib: $(filter arch/$(ARCH)/lib, $(u-boot-dirs))
+endif
+
# The setlocalversion script comes from linux and expects a
# KERNELVERSION variable in the environment for figuring out which
# annotated tags are relevant. Pass UBOOTVERSION.
diff --git a/env/mtd.c b/env/mtd.c
index d7ec30e183a..b26ee80985a 100644
--- a/env/mtd.c
+++ b/env/mtd.c
@@ -131,6 +131,8 @@ static int env_mtd_save(void)
puts("done\n");
done:
+ put_mtd_device(mtd_env);
+
if (saved_buf)
free(saved_buf);
@@ -188,6 +190,8 @@ static int env_mtd_load(void)
gd->env_valid = ENV_VALID;
out:
+ put_mtd_device(mtd_env);
+
free(buf);
return ret;
@@ -197,7 +201,7 @@ static int env_mtd_erase(void)
{
struct mtd_info *mtd_env;
u32 sect_size, sect_num;
- char *saved_buf, *tmp;
+ char *saved_buf = NULL, *tmp;
struct erase_info ei;
size_t ret_len;
int remaining;
@@ -280,6 +284,8 @@ static int env_mtd_erase(void)
ret = 0;
done:
+ put_mtd_device(mtd_env);
+
if (saved_buf)
free(saved_buf);