]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mmc: dw_mmc: dw_mci_get_cd check MMC_CAP_NONREMOVABLE
authorZhangfei Gao <zhangfei.gao@linaro.org>
Tue, 5 May 2015 08:54:49 +0000 (16:54 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Fri, 8 May 2015 06:55:47 +0000 (08:55 +0200)
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 <zhangfei.gao@linaro.org>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c

index 69952b20563c43a681316229cc7d831803d4e5be..5f5adafb253afec16429c3bb357e15be8d07bbb7 100644 (file)
@@ -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;