Skip to content
Snippets Groups Projects
Commit 8687d5c8 authored by Paul Burton's avatar Paul Burton Committed by Pantelis Antoniou
Browse files

mmc: size optimization when !CONFIG_MMC_SPI


When CONFIG_MMC_SPI is not enabled, the MMC_MODE_SPI capability can
never be set. However there is code in mmc.c which uses the
mmc_host_is_spi macro to check that capability & act accordingly. If we
expand that macro to 0 when CONFIG_MMC_SPI is not set (since it will
always be 0 at runtime anyway) then the compiler can optimize away the
SPI-specific code paths in mmc.c.

Signed-off-by: default avatarPaul Burton <paul.burton@imgtec.com>
parent 56196826
No related branches found
No related tags found
No related merge requests found
......@@ -335,7 +335,11 @@ int mmc_start_init(struct mmc *mmc);
void mmc_set_preinit(struct mmc *mmc, int preinit);
#ifdef CONFIG_GENERIC_MMC
#ifdef CONFIG_MMC_SPI
#define mmc_host_is_spi(mmc) ((mmc)->host_caps & MMC_MODE_SPI)
#else
#define mmc_host_is_spi(mmc) 0
#endif
struct mmc *mmc_spi_init(uint bus, uint cs, uint speed, uint mode);
#else
int mmc_legacy_init(int verbose);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment