diff mbox series

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

Message ID 20200220044534.19600-3-jh80.chung@samsung.com
State Changes Requested
Delegated to: Peng Fan
Headers show
Series Remove CONFIG_MMC_BROKEN_CD | expand

Commit Message

Jaehoon Chung Feb. 20, 2020, 4:45 a.m. UTC
broken-cd is provided to dt-property.
Then it's set to MMC_CAP_NEEDS_POLL flag.

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

Patch

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);