From: Masahiro Yamada Date: Thu, 25 Aug 2016 07:07:37 +0000 (+0900) Subject: mmc: sdhci: move SDMA capability check to sdhci_setup_cfg() X-Git-Tag: v2016.11-rc1~121^2~6 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=15bd09959fddd2782484683818bf05fb154237cb;p=oweals%2Fu-boot.git mmc: sdhci: move SDMA capability check to sdhci_setup_cfg() If CONFIG_BLK is enabled, add_sdhci() is never called. Move this quirk handling to sdhci_setup_cfg(), which is now the central place for hardware capability checks. Signed-off-by: Masahiro Yamada --- diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index c66151c8cf..da73653ffa 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -519,6 +519,14 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, u32 caps; caps = sdhci_readl(host, SDHCI_CAPABILITIES); + +#ifdef CONFIG_MMC_SDMA + if (!(caps & SDHCI_CAN_DO_SDMA)) { + printf("%s: Your controller doesn't support SDMA!!\n", + __func__); + return -EINVAL; + } +#endif host->version = sdhci_readw(host, SDHCI_HOST_VERSION); cfg->name = host->name; @@ -585,17 +593,6 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) { int ret; -#ifdef CONFIG_MMC_SDMA - unsigned int caps; - - caps = sdhci_readl(host, SDHCI_CAPABILITIES); - if (!(caps & SDHCI_CAN_DO_SDMA)) { - printf("%s: Your controller doesn't support SDMA!!\n", - __func__); - return -1; - } -#endif - ret = sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk); if (ret) return ret;