[PATCH 2/3] mmc: check the flags of host_caps about broken-cd

Jaehoon Chung jh80.chung at samsung.com
Thu Feb 20 05:45:33 CET 2020


broken-cd is provided to dt-property.
Then it's set to MMC_CAP_NEEDS_POLL flag.

Signed-off-by: Jaehoon Chung <jh80.chung at samsung.com>
---
 drivers/mmc/mmc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index b50fcbf6cf..cac60ea034 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -2846,11 +2846,11 @@ 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)
-	no_card = mmc_getcd(mmc) == 0;
-#else
-	no_card = 0;
-#endif
+	if (mmc->host_caps & MMC_CAP_NEEDS_POLL)
+		no_card = 0;
+	else
+		no_card = mmc_getcd(mmc) == 0;
+
 #if !CONFIG_IS_ENABLED(DM_MMC)
 	/* we pretend there's no card when init is NULL */
 	no_card = no_card || (mmc->cfg->ops->init == NULL);
-- 
2.25.0



More information about the U-Boot mailing list