env_mmc: correct fini partition to match init partition
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: 6e7b7df4df ("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>
This commit is contained in:
parent
6dc93e7087
commit
19345d7c94
|
|
@ -113,7 +113,7 @@ static void fini_mmc_for_env(struct mmc *mmc)
|
||||||
#ifdef CONFIG_SPL_BUILD
|
#ifdef CONFIG_SPL_BUILD
|
||||||
dev = 0;
|
dev = 0;
|
||||||
#endif
|
#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);
|
mmc_switch_part(dev, mmc->part_num);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue