From: Zhangfei Gao Date: Tue, 5 May 2015 08:54:49 +0000 (+0800) Subject: mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4de3bf66c61ef708d8f22d7f990339668a858e7d;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE When non-removable is used for emmc, MMC_CAP_NONREMOVABLE should also be checked, otherwise detection fail since present=0 Signed-off-by: Zhangfei Gao Signed-off-by: Jaehoon Chung Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 69952b20563c..5f5adafb253a 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -1302,7 +1302,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc) int gpio_cd = mmc_gpio_get_cd(mmc); /* Use platform get_cd function, else try onboard card detect */ - if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) + if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) || + (mmc->caps & MMC_CAP_NONREMOVABLE)) present = 1; else if (!IS_ERR_VALUE(gpio_cd)) present = gpio_cd;