diff options
-rw-r--r-- | drivers/mmc/host/dw_mmc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 97a8b0c97341..a9dfb26972f2 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c | |||
@@ -2995,17 +2995,15 @@ static void dw_mci_enable_cd(struct dw_mci *host) | |||
2995 | { | 2995 | { |
2996 | unsigned long irqflags; | 2996 | unsigned long irqflags; |
2997 | u32 temp; | 2997 | u32 temp; |
2998 | struct dw_mci_slot *slot; | ||
2999 | 2998 | ||
3000 | /* | 2999 | /* |
3001 | * No need for CD if all slots have a non-error GPIO | 3000 | * No need for CD if all slots have a non-error GPIO |
3002 | * as well as broken card detection is found. | 3001 | * as well as broken card detection is found. |
3003 | */ | 3002 | */ |
3004 | slot = host->slot; | 3003 | if (host->slot->mmc->caps & MMC_CAP_NEEDS_POLL) |
3005 | if (slot->mmc->caps & MMC_CAP_NEEDS_POLL) | ||
3006 | return; | 3004 | return; |
3007 | 3005 | ||
3008 | if (mmc_gpio_get_cd(slot->mmc) < 0) { | 3006 | if (mmc_gpio_get_cd(host->slot->mmc) < 0) { |
3009 | spin_lock_irqsave(&host->irq_lock, irqflags); | 3007 | spin_lock_irqsave(&host->irq_lock, irqflags); |
3010 | temp = mci_readl(host, INTMASK); | 3008 | temp = mci_readl(host, INTMASK); |
3011 | temp |= SDMMC_INT_CD; | 3009 | temp |= SDMMC_INT_CD; |
@@ -3273,7 +3271,6 @@ int dw_mci_runtime_resume(struct device *dev) | |||
3273 | { | 3271 | { |
3274 | int ret = 0; | 3272 | int ret = 0; |
3275 | struct dw_mci *host = dev_get_drvdata(dev); | 3273 | struct dw_mci *host = dev_get_drvdata(dev); |
3276 | struct dw_mci_slot *slot = host->slot; | ||
3277 | 3274 | ||
3278 | if (host->slot && | 3275 | if (host->slot && |
3279 | (mmc_can_gpio_cd(host->slot->mmc) || | 3276 | (mmc_can_gpio_cd(host->slot->mmc) || |
@@ -3313,11 +3310,11 @@ int dw_mci_runtime_resume(struct device *dev) | |||
3313 | mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); | 3310 | mci_writel(host, CTRL, SDMMC_CTRL_INT_ENABLE); |
3314 | 3311 | ||
3315 | 3312 | ||
3316 | if (slot->mmc->pm_flags & MMC_PM_KEEP_POWER) | 3313 | if (host->slot->mmc->pm_flags & MMC_PM_KEEP_POWER) |
3317 | dw_mci_set_ios(slot->mmc, &slot->mmc->ios); | 3314 | dw_mci_set_ios(host->slot->mmc, &host->slot->mmc->ios); |
3318 | 3315 | ||
3319 | /* Force setup bus to guarantee available clock output */ | 3316 | /* Force setup bus to guarantee available clock output */ |
3320 | dw_mci_setup_bus(slot, true); | 3317 | dw_mci_setup_bus(host->slot, true); |
3321 | 3318 | ||
3322 | /* Now that slots are all setup, we can enable card detect */ | 3319 | /* Now that slots are all setup, we can enable card detect */ |
3323 | dw_mci_enable_cd(host); | 3320 | dw_mci_enable_cd(host); |