mmc: sdhci: properly check card present state when quirk NO_CARD_NO_RESET is set
authorIvan T. Ivanov <ivan.ivanov@linaro.org>
Mon, 6 Jul 2015 12:16:21 +0000 (15:16 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Aug 2015 09:32:44 +0000 (11:32 +0200)
Controller could have both NO_CARD_NO_RESET and BROKEN_CARD_DETECTION
quirks set. Use sdhci_do_get_cd() when applying NO_CARD_NO_RESET, which
properly check for BROKEN_CARD_DETECTION quirk.

Signed-off-by: Ivan T. Ivanov <ivan.ivanov@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index cb138d6ad1f299d774d7cf9ce4fe06a0b4914d00..c83d11080da0ac283a933689157c189d16c9a374 100644 (file)
@@ -207,8 +207,7 @@ EXPORT_SYMBOL_GPL(sdhci_reset);
 static void sdhci_do_reset(struct sdhci_host *host, u8 mask)
 {
        if (host->quirks & SDHCI_QUIRK_NO_CARD_NO_RESET) {
-               if (!(sdhci_readl(host, SDHCI_PRESENT_STATE) &
-                       SDHCI_CARD_PRESENT))
+               if (!sdhci_do_get_cd(host))
                        return;
        }