Skip to content

Commit 4de3bf6

Browse files
zhangfeigaostorulf
authored andcommitted
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 <[email protected]> Signed-off-by: Jaehoon Chung <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent 4b24472 commit 4de3bf6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mmc/host/dw_mmc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,8 @@ static int dw_mci_get_cd(struct mmc_host *mmc)
13021302
int gpio_cd = mmc_gpio_get_cd(mmc);
13031303

13041304
/* Use platform get_cd function, else try onboard card detect */
1305-
if (brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION)
1305+
if ((brd->quirks & DW_MCI_QUIRK_BROKEN_CARD_DETECTION) ||
1306+
(mmc->caps & MMC_CAP_NONREMOVABLE))
13061307
present = 1;
13071308
else if (!IS_ERR_VALUE(gpio_cd))
13081309
present = gpio_cd;

0 commit comments

Comments
 (0)