From patchwork Thu Feb 20 04:45:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 236634 List-Id: U-Boot discussion From: jh80.chung at samsung.com (Jaehoon Chung) Date: Thu, 20 Feb 2020 13:45:33 +0900 Subject: [PATCH 2/3] mmc: check the flags of host_caps about broken-cd In-Reply-To: <20200220044534.19600-1-jh80.chung@samsung.com> References: <20200220044534.19600-1-jh80.chung@samsung.com> Message-ID: <20200220044534.19600-3-jh80.chung@samsung.com> broken-cd is provided to dt-property. Then it's set to MMC_CAP_NEEDS_POLL flag. Signed-off-by: Jaehoon Chung --- 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);