mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-02 01:26:32 +00:00
env: mmc: Clean up env_mmc_load() ifdeffery
Rename the variants of env_mmc_load() for redundant and non-redundant environment to env_mmc_load_redundant() and env_mmc_load_singular() respectively and convert the env_mmc_load() implementation to use of if (IS_ENABLED(...)). As a result, drop __maybe_unused from mmc_env_is_redundant_in_both_boot_hwparts(). Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
5ce1d026b1
commit
8cf24a03a4
1 changed files with 14 additions and 11 deletions
25
env/mmc.c
vendored
25
env/mmc.c
vendored
|
@ -205,7 +205,7 @@ static inline s64 mmc_offset(struct mmc *mmc, int copy)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static bool __maybe_unused mmc_env_is_redundant_in_both_boot_hwparts(struct mmc *mmc)
|
static bool mmc_env_is_redundant_in_both_boot_hwparts(struct mmc *mmc)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* In case the environment is redundant, stored in eMMC hardware boot
|
* In case the environment is redundant, stored in eMMC hardware boot
|
||||||
|
@ -448,13 +448,7 @@ static inline int read_env(struct mmc *mmc, unsigned long size,
|
||||||
return (n == blk_cnt) ? 0 : -1;
|
return (n == blk_cnt) ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(ENV_IS_EMBEDDED)
|
static int env_mmc_load_redundant(void)
|
||||||
static int env_mmc_load(void)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#elif defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT)
|
|
||||||
static int env_mmc_load(void)
|
|
||||||
{
|
{
|
||||||
struct mmc *mmc;
|
struct mmc *mmc;
|
||||||
u32 offset1, offset2;
|
u32 offset1, offset2;
|
||||||
|
@ -510,8 +504,8 @@ err:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#else /* ! CONFIG_SYS_REDUNDAND_ENVIRONMENT */
|
|
||||||
static int env_mmc_load(void)
|
static int env_mmc_load_singular(void)
|
||||||
{
|
{
|
||||||
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
|
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
|
||||||
struct mmc *mmc;
|
struct mmc *mmc;
|
||||||
|
@ -556,7 +550,16 @@ err:
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_SYS_REDUNDAND_ENVIRONMENT */
|
|
||||||
|
static int env_mmc_load(void)
|
||||||
|
{
|
||||||
|
if (IS_ENABLED(CONFIG_ENV_IS_EMBEDDED))
|
||||||
|
return 0;
|
||||||
|
else if (IS_ENABLED(CONFIG_SYS_REDUNDAND_ENVIRONMENT))
|
||||||
|
return env_mmc_load_redundant();
|
||||||
|
else
|
||||||
|
return env_mmc_load_singular();
|
||||||
|
}
|
||||||
|
|
||||||
U_BOOT_ENV_LOCATION(mmc) = {
|
U_BOOT_ENV_LOCATION(mmc) = {
|
||||||
.location = ENVL_MMC,
|
.location = ENVL_MMC,
|
||||||
|
|
Loading…
Add table
Reference in a new issue