diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-08-25 16:07:35 +0900 |
---|---|---|
committer | Jaehoon Chung <jh80.chung@samsung.com> | 2016-09-20 06:46:01 +0900 |
commit | 6c67954c93ea09bccc5bbc984ff60a2c28eeb733 (patch) | |
tree | 3f1bae0b266e26ec3d268593b0998e6fd0681eb7 /drivers/mmc/sdhci.c | |
parent | 8d549b61dc1b3a99a47738bd258813d336f6475b (diff) | |
download | u-boot-6c67954c93ea09bccc5bbc984ff60a2c28eeb733.tar.gz |
mmc: sdhci: move error message to more relevant place
"Hardware doesn't specify base clock frequency" may not be only the
error case of sdhci_setup_cfg(). It is better to print this where
the corresponding error is triggered.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'drivers/mmc/sdhci.c')
-rw-r--r-- | drivers/mmc/sdhci.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 91cc8b22da..d886777f9f 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -536,8 +536,11 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host, SDHCI_CLOCK_BASE_SHIFT; cfg->f_max *= 1000000; } - if (cfg->f_max == 0) + if (cfg->f_max == 0) { + printf("%s: Hardware doesn't specify base clock frequency\n", + __func__); return -EINVAL; + } if (min_clk) cfg->f_min = min_clk; else { @@ -577,6 +580,8 @@ int sdhci_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg) #else int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) { + int ret; + #ifdef CONFIG_MMC_SDMA unsigned int caps; @@ -588,11 +593,9 @@ int add_sdhci(struct sdhci_host *host, u32 max_clk, u32 min_clk) } #endif - if (sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk)) { - printf("%s: Hardware doesn't specify base clock frequency\n", - __func__); - return -EINVAL; - } + ret = sdhci_setup_cfg(&host->cfg, host, max_clk, min_clk); + if (ret) + return ret; if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE) host->cfg.voltages |= host->voltages; |