]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
env_mmc: correct fini partition to match init partition
authorPeter Bigot <pab@pabigot.com>
Wed, 3 Sep 2014 17:22:43 +0000 (12:22 -0500)
committerPantelis Antoniou <panto@antoniou-consulting.com>
Fri, 3 Oct 2014 14:26:50 +0000 (17:26 +0300)
The code to set the MMC partition uses an weak function to obtain the
correct partition number.  Use that instead of the compile-time default
when deciding whether it needs to switch back.

Fixes: 6e7b7df4df43574 ("env_mmc: support env partition setup in runtime")
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Acked-by: Dmitry Lifshitz <lifshitz@compulab.co.il>
Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
common/env_mmc.c

index a7621a897c44f475a185547cfe051880c0847d0d..14648e37bdf284ccb683740b5ce3d05df47e3779 100644 (file)
@@ -113,7 +113,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
 #ifdef CONFIG_SPL_BUILD
        dev = 0;
 #endif
-       if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num)
+       if (mmc_get_env_part(mmc) != mmc->part_num)
                mmc_switch_part(dev, mmc->part_num);
 #endif
 }