@@ -893,8 +893,7 @@ static struct sdhci_ops sdhci_esdhc_ops = {
static const struct sdhci_pltfm_data sdhci_esdhc_imx_pdata = {
.quirks = ESDHC_DEFAULT_QUIRKS | SDHCI_QUIRK_NO_HISPD_BIT
| SDHCI_QUIRK_NO_ENDATTR_IN_NOPDESC
- | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC
- | SDHCI_QUIRK_BROKEN_CARD_DETECTION,
+ | SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC,
.ops = &sdhci_esdhc_ops,
};
@@ -1084,18 +1083,18 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
"failed to request card-detect gpio!\n");
goto disable_clk;
}
- /* fall through */
+ break;
case ESDHC_CD_CONTROLLER:
- /* we have a working card_detect back */
- host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
break;
case ESDHC_CD_PERMANENT:
host->mmc->caps |= MMC_CAP_NONREMOVABLE;
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
break;
case ESDHC_CD_NONE:
+ host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
break;
}
The driver always sets the flag and clears it afterwards in some cases. Instead, leave the flag cleared and set it when needed which makes the code easier to read. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> --- drivers/mmc/host/sdhci-esdhc-imx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)