aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorJun Nie <jun.nie@linaro.org>2018-01-02 12:25:57 +0800
committerJaehoon Chung <jh80.chung@samsung.com>2018-01-24 16:12:03 +0900
commit2f516e4aa286eb0203e34ab9be68b08f7a3c44c1 (patch)
tree89314a7e0fe66e9f7fb779179a0a8eecf5881766 /drivers/mmc/mmc.c
parentc0fafe64a5a8fbbd48c4d3bed730f45dfa6d85b5 (diff)
mmc: Poll for broken card detection case
Poll for broken card detection case instead of return no card detected. Signed-off-by: Jun Nie <jun.nie@linaro.org>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 2d0e7bb3a2..255310a8e6 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2493,8 +2493,12 @@ int mmc_start_init(struct mmc *mmc)
mmc->host_caps = mmc->cfg->host_caps | MMC_CAP(SD_LEGACY) |
MMC_CAP(MMC_LEGACY) | MMC_MODE_1BIT;
+#if !defined(CONFIG_MMC_BROKEN_CD)
/* we pretend there's no card when init is NULL */
no_card = mmc_getcd(mmc) == 0;
+#else
+ no_card = 0;
+#endif
#if !CONFIG_IS_ENABLED(DM_MMC)
no_card = no_card || (mmc->cfg->ops->init == NULL);
#endif