diff options
author | Paul Burton <paul.burton@imgtec.com> | 2013-09-04 16:12:26 +0100 |
---|---|---|
committer | Pantelis Antoniou <panto@antoniou-consulting.com> | 2013-09-17 20:03:44 +0300 |
commit | 8687d5c80c9b4d66b4c33e34ef8eb36cf93d9ec7 (patch) | |
tree | cbbce7771a6bb4ee1e4e0774c77d41540bf91f5b /include | |
parent | 561968266431e16790e0d71086341f28e6930800 (diff) | |
download | u-boot-imx-8687d5c80c9b4d66b4c33e34ef8eb36cf93d9ec7.zip u-boot-imx-8687d5c80c9b4d66b4c33e34ef8eb36cf93d9ec7.tar.gz u-boot-imx-8687d5c80c9b4d66b4c33e34ef8eb36cf93d9ec7.tar.bz2 |
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: Paul Burton <paul.burton@imgtec.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/mmc.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h index 228d771..214b9ed 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -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); |