From patchwork Mon Apr 11 13:32:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 65514 Delivered-To: patches@linaro.org Received: by 10.112.43.237 with SMTP id z13csp1475852lbl; Mon, 11 Apr 2016 06:32:49 -0700 (PDT) X-Received: by 10.112.132.36 with SMTP id or4mr8094454lbb.71.1460381567972; Mon, 11 Apr 2016 06:32:47 -0700 (PDT) Return-Path: Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com. [2a00:1450:4010:c07::230]) by mx.google.com with ESMTPS id b184si14170616lfe.137.2016.04.11.06.32.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Apr 2016 06:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) client-ip=2a00:1450:4010:c07::230; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::230 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x230.google.com with SMTP id j11so156722807lfb.1 for ; Mon, 11 Apr 2016 06:32:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id; bh=9RCzl8jc+EPhADCfc04D1vOVFGkaEsG1eLdNf/lqmEw=; b=SimSq+Z/N2PdbD+7cvXekvkfMyuh9xorxiPNJmPuwc+66BOx/SMxMG1dALYjWIwUS8 DgBFePR8wQBlwE6Q0Ok6P1BF5lMzXJ7C72dp4KCYPy3JCm+x/5XLIxGkkG+jqoipS9dp AK08yuo7VNy/EMMlQz3588hDtGJDcrB/7yYkQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=9RCzl8jc+EPhADCfc04D1vOVFGkaEsG1eLdNf/lqmEw=; b=RAMTUEAL4UpkRvWSjWQzL0N/rLPr5meMtbmueNuhZIRbh8Pwc3h4lfaE7LhLyyUB2k n2x1AOouM5N0yBqfSzgmxAkArsuaSewwj++oeKiC6JVQsaAHNdpMUneGU1DitpxRUFbP +vPqAsF46FtqQWAu5/vrJCE0yrRYpCEKNCopOTBNge3/0J1PtPJb1A2omNKqEGUxd+DJ TnXXWB3U6GLYP4md+9PBwyuC0lPZssBTMRV4ZdXelaUsp8n4zF+lJCwQuFmyjuRKMdWV HAItt3culIusXc9wPjsuIkfA5LFsWn9yVKOFWSR/V4IhJMo6xvZp6FQDpDognt+WjYUz tNxA== X-Gm-Message-State: AD7BkJJG1VZVrILn9OjNNL1c39rT6ZZy5S0nycWPqHzK9yz4dMxtWrD7Hc2qCMOIsJT5BWTPp5E= X-Received: by 10.112.170.201 with SMTP id ao9mr6629449lbc.38.1460381566519; Mon, 11 Apr 2016 06:32:46 -0700 (PDT) Return-Path: Received: from uffe-Latitude-E6430s.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id z7sm1062766lbr.33.2016.04.11.06.32.45 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Apr 2016 06:32:45 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Subject: [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition Date: Mon, 11 Apr 2016 15:32:41 +0200 Message-Id: <1460381561-12511-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 There are no need to have two versions of sdhci_runtime_pm_bus_off|on(), depending on whether CONFIG_PM is set or unset. Thus it's easy to move the implementation of these functions a bit earlier to avoid the unnecessary pre-definition of them, so let's do that. Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci.c | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 8e74e75..c6dbe65 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -55,18 +55,6 @@ static int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode); static void sdhci_enable_preset_value(struct sdhci_host *host, bool enable); static int sdhci_do_get_cd(struct sdhci_host *host); -#ifdef CONFIG_PM -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host); -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host); -#else -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) -{ -} -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) -{ -} -#endif - static void sdhci_dumpregs(struct sdhci_host *host) { pr_debug(DRIVER_NAME ": =========== REGISTER DUMP (%s)===========\n", @@ -161,6 +149,22 @@ static void sdhci_disable_card_detection(struct sdhci_host *host) sdhci_set_card_detection(host, false); } +static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) +{ + if (host->bus_on) + return; + host->bus_on = true; + pm_runtime_get_noresume(host->mmc->parent); +} + +static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) +{ + if (!host->bus_on) + return; + host->bus_on = false; + pm_runtime_put_noidle(host->mmc->parent); +} + void sdhci_reset(struct sdhci_host *host, u8 mask) { unsigned long timeout; @@ -2667,22 +2671,6 @@ int sdhci_resume_host(struct sdhci_host *host) EXPORT_SYMBOL_GPL(sdhci_resume_host); -static void sdhci_runtime_pm_bus_on(struct sdhci_host *host) -{ - if (host->bus_on) - return; - host->bus_on = true; - pm_runtime_get_noresume(host->mmc->parent); -} - -static void sdhci_runtime_pm_bus_off(struct sdhci_host *host) -{ - if (!host->bus_on) - return; - host->bus_on = false; - pm_runtime_put_noidle(host->mmc->parent); -} - int sdhci_runtime_suspend_host(struct sdhci_host *host) { unsigned long flags;