diff options
-rw-r--r-- | drivers/mmc/host/sdhci.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7b008675d7fc..dfa71b32c8e0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1697,9 +1697,6 @@ static int sdhci_get_ro(struct mmc_host *mmc) static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) { - if (enable) - sdhci_runtime_pm_get(host); - if (host->flags & SDHCI_DEVICE_DEAD) goto out; @@ -1718,9 +1715,6 @@ static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable) sdhci_mask_irqs(host, SDHCI_INT_CARD_INT); out: mmiowb(); - - if (!enable) - sdhci_runtime_pm_put(host); } static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) @@ -1728,9 +1722,15 @@ static void sdhci_enable_sdio_irq(struct mmc_host *mmc, int enable) struct sdhci_host *host = mmc_priv(mmc); unsigned long flags; + if (enable) + sdhci_runtime_pm_get(host); + spin_lock_irqsave(&host->lock, flags); sdhci_enable_sdio_irq_nolock(host, enable); spin_unlock_irqrestore(&host->lock, flags); + + if (!enable) + sdhci_runtime_pm_put(host); } static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, |