diff options
-rw-r--r-- | drivers/mmc/host/sdhci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index d98b1992d778..0e15c79014fb 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mmc/mmc.h> | 28 | #include <linux/mmc/mmc.h> |
29 | #include <linux/mmc/host.h> | 29 | #include <linux/mmc/host.h> |
30 | #include <linux/mmc/card.h> | 30 | #include <linux/mmc/card.h> |
31 | #include <linux/mmc/slot-gpio.h> | ||
31 | 32 | ||
32 | #include "sdhci.h" | 33 | #include "sdhci.h" |
33 | 34 | ||
@@ -1293,6 +1294,13 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) | |||
1293 | present = sdhci_readl(host, SDHCI_PRESENT_STATE) & | 1294 | present = sdhci_readl(host, SDHCI_PRESENT_STATE) & |
1294 | SDHCI_CARD_PRESENT; | 1295 | SDHCI_CARD_PRESENT; |
1295 | 1296 | ||
1297 | /* If we're using a cd-gpio, testing the presence bit might fail. */ | ||
1298 | if (!present) { | ||
1299 | int ret = mmc_gpio_get_cd(host->mmc); | ||
1300 | if (ret > 0) | ||
1301 | present = true; | ||
1302 | } | ||
1303 | |||
1296 | if (!present || host->flags & SDHCI_DEVICE_DEAD) { | 1304 | if (!present || host->flags & SDHCI_DEVICE_DEAD) { |
1297 | host->mrq->cmd->error = -ENOMEDIUM; | 1305 | host->mrq->cmd->error = -ENOMEDIUM; |
1298 | tasklet_schedule(&host->finish_tasklet); | 1306 | tasklet_schedule(&host->finish_tasklet); |