Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8620ab92 authored by xiaonian's avatar xiaonian Committed by Xiaonian Wang
Browse files

mmc: sdhci: Remove redundant runtime PM calls



Commit 9250aea7 ("mmc: core: Enable runtime PM management of host
devices"), made some calls to the runtime PM API from the driver
redundant. Especially those which deals with runtime PM reference
counting, so let's remove them.

Moreover as SDHCI have its own wrapper functions for runtime PM these
becomes superfluous, so let's remove them as well.

Change-Id: I34496240f52c84f678780b2e7878445b36680771
Signed-off-by: default avatarxiaonian <xiaonian@codeaurora.org>
parent 01b6db59
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -58,20 +58,6 @@ static void sdhci_enable_sdio_irq_nolock(struct sdhci_host *host, int enable);

static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable);

#ifdef CONFIG_PM
static int sdhci_runtime_pm_get(struct sdhci_host *host);
static int sdhci_runtime_pm_put(struct sdhci_host *host);
#else
static inline int sdhci_runtime_pm_get(struct sdhci_host *host)
{
	return 0;
}
static inline int sdhci_runtime_pm_put(struct sdhci_host *host)
{
	return 0;
}
#endif

static void sdhci_dump_state(struct sdhci_host *host)
{
	struct mmc_host *mmc = host->mmc;
@@ -1780,7 +1766,6 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
		host->mrq = NULL;
		sdhci_dumpregs(host);
		mmc_request_done(host->mmc, mrq);
		sdhci_runtime_pm_put(host);
		return;
	}

@@ -2367,10 +2352,8 @@ static int sdhci_enhanced_strobe(struct mmc_host *mmc)
	struct sdhci_host *host = mmc_priv(mmc);
	int err = 0;

	sdhci_runtime_pm_get(host);
	if (host->ops->enhanced_strobe)
		err = host->ops->enhanced_strobe(host);
	sdhci_runtime_pm_put(host);

	return err;
}
@@ -2720,9 +2703,7 @@ static void sdhci_force_err_irq(struct mmc_host *mmc, u64 errmask)
	u16 mask = errmask & 0xFFFF;

	pr_err("%s: Force raise error mask:0x%04x\n", __func__, mask);
	sdhci_runtime_pm_get(host);
	sdhci_writew(host, mask, SDHCI_SET_INT_ERROR);
	sdhci_runtime_pm_put(host);
}

static const struct mmc_host_ops sdhci_ops = {
@@ -3508,17 +3489,6 @@ int sdhci_resume_host(struct sdhci_host *host)

EXPORT_SYMBOL_GPL(sdhci_resume_host);

static int sdhci_runtime_pm_get(struct sdhci_host *host)
{
	return pm_runtime_get_sync(host->mmc->parent);
}

static int sdhci_runtime_pm_put(struct sdhci_host *host)
{
	pm_runtime_mark_last_busy(host->mmc->parent);
	return pm_runtime_put_autosuspend(host->mmc->parent);
}

int sdhci_runtime_suspend_host(struct sdhci_host *host)
{
	unsigned long flags;