* [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition
@ 2016-04-11 13:32 Ulf Hansson
2016-04-12 11:24 ` Adrian Hunter
0 siblings, 1 reply; 2+ messages in thread
From: Ulf Hansson @ 2016-04-11 13:32 UTC (permalink / raw)
To: linux-mmc, Ulf Hansson, Adrian Hunter
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 <ulf.hansson@linaro.org>
---
drivers/mmc/host/sdhci.c | 44 ++++++++++++++++----------------------------
1 file changed, 16 insertions(+), 28 deletions(-)
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;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition
2016-04-11 13:32 [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition Ulf Hansson
@ 2016-04-12 11:24 ` Adrian Hunter
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Hunter @ 2016-04-12 11:24 UTC (permalink / raw)
To: Ulf Hansson, linux-mmc
On 11/04/16 16:32, Ulf Hansson wrote:
> 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 <ulf.hansson@linaro.org>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
> ---
> drivers/mmc/host/sdhci.c | 44 ++++++++++++++++----------------------------
> 1 file changed, 16 insertions(+), 28 deletions(-)
>
> 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;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-12 11:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-11 13:32 [PATCH] mmc: sdhci: Move sdhci_runtime_pm_bus_off|on() to avoid pre-definition Ulf Hansson
2016-04-12 11:24 ` Adrian Hunter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.