linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set
@ 2021-10-21 13:43 Tony Lindgren
  2021-10-21 19:34 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Tony Lindgren @ 2021-10-21 13:43 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Adrian Hunter, Chunyan Zhang, Faiz Abbas, Kishon Vijay Abraham I,
	Santosh Shilimkar, linux-mmc, linux-omap, kernel test robot

Commit f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
combined the use of runtime PM and system suspend functions but left the
ifdef CONFIG_PM_SLEEP in place causing undeclared identifier error for
sdhci_omap_runtime_suspend if CONFIG_PM_SLEEP is not enabled.

Let's fix the error by removing ifdef CONFIG_PM_SLEEP and tagging the
reset of the PM related functions with __maybe_unused.

Let's also remove the forward declaration for sdhci_omap_context_save(),
that was accidentally left from an earlier version and is no longer used.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/mmc/host/sdhci-omap.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
--- a/drivers/mmc/host/sdhci-omap.c
+++ b/drivers/mmc/host/sdhci-omap.c
@@ -1210,8 +1210,6 @@ static const struct soc_device_attribute sdhci_omap_soc_devices[] = {
 	}
 };
 
-static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host);
-
 static int sdhci_omap_probe(struct platform_device *pdev)
 {
 	int ret;
@@ -1417,8 +1415,8 @@ static int sdhci_omap_remove(struct platform_device *pdev)
 
 	return 0;
 }
-#ifdef CONFIG_PM_SLEEP
-static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
+
+static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
 {
 	omap_host->con = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON);
 	omap_host->hctl = sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL);
@@ -1429,7 +1427,7 @@ static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
 }
 
 /* Order matters here, HCTL must be restored in two phases */
-static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
+static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
 {
 	sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl);
 	sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa);
@@ -1471,7 +1469,6 @@ static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops sdhci_omap_dev_pm_ops = {
 	SET_RUNTIME_PM_OPS(sdhci_omap_runtime_suspend,
-- 
2.33.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set
  2021-10-21 13:43 [PATCH] mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set Tony Lindgren
@ 2021-10-21 19:34 ` Ulf Hansson
  2021-10-21 19:49   ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2021-10-21 19:34 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Adrian Hunter, Chunyan Zhang, Faiz Abbas, Kishon Vijay Abraham I,
	Santosh Shilimkar, linux-mmc, linux-omap, kernel test robot

On Thu, 21 Oct 2021 at 15:43, Tony Lindgren <tony@atomide.com> wrote:
>
> Commit f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
> combined the use of runtime PM and system suspend functions but left the
> ifdef CONFIG_PM_SLEEP in place causing undeclared identifier error for
> sdhci_omap_runtime_suspend if CONFIG_PM_SLEEP is not enabled.
>
> Let's fix the error by removing ifdef CONFIG_PM_SLEEP and tagging the
> reset of the PM related functions with __maybe_unused.
>
> Let's also remove the forward declaration for sdhci_omap_context_save(),
> that was accidentally left from an earlier version and is no longer used.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  drivers/mmc/host/sdhci-omap.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> --- a/drivers/mmc/host/sdhci-omap.c
> +++ b/drivers/mmc/host/sdhci-omap.c
> @@ -1210,8 +1210,6 @@ static const struct soc_device_attribute sdhci_omap_soc_devices[] = {
>         }
>  };
>
> -static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host);
> -
>  static int sdhci_omap_probe(struct platform_device *pdev)
>  {
>         int ret;
> @@ -1417,8 +1415,8 @@ static int sdhci_omap_remove(struct platform_device *pdev)
>
>         return 0;
>  }
> -#ifdef CONFIG_PM_SLEEP

This above should be:
#ifdef CONFIG_PM

sdhci_runtime_suspend|resume() host is defined like this as well, so
the below would trigger a compiler error when built with CONFIG_PM
unset.

> -static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
> +
> +static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
>  {
>         omap_host->con = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON);
>         omap_host->hctl = sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL);
> @@ -1429,7 +1427,7 @@ static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
>  }
>
>  /* Order matters here, HCTL must be restored in two phases */
> -static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
> +static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
>  {
>         sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl);
>         sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa);
> @@ -1471,7 +1469,6 @@ static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
>
>         return 0;
>  }
> -#endif
>
>  static const struct dev_pm_ops sdhci_omap_dev_pm_ops = {
>         SET_RUNTIME_PM_OPS(sdhci_omap_runtime_suspend,

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set
  2021-10-21 19:34 ` Ulf Hansson
@ 2021-10-21 19:49   ` Ulf Hansson
  0 siblings, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2021-10-21 19:49 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Adrian Hunter, Chunyan Zhang, Faiz Abbas, Kishon Vijay Abraham I,
	Santosh Shilimkar, linux-mmc, linux-omap, kernel test robot

On Thu, 21 Oct 2021 at 21:34, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Thu, 21 Oct 2021 at 15:43, Tony Lindgren <tony@atomide.com> wrote:
> >
> > Commit f433e8aac6b9 ("mmc: sdhci-omap: Implement PM runtime functions")
> > combined the use of runtime PM and system suspend functions but left the
> > ifdef CONFIG_PM_SLEEP in place causing undeclared identifier error for
> > sdhci_omap_runtime_suspend if CONFIG_PM_SLEEP is not enabled.
> >
> > Let's fix the error by removing ifdef CONFIG_PM_SLEEP and tagging the
> > reset of the PM related functions with __maybe_unused.
> >
> > Let's also remove the forward declaration for sdhci_omap_context_save(),
> > that was accidentally left from an earlier version and is no longer used.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>

Well, I decided to amend the patch and apply it. It needed a small
rebase on top of Geert's other patch too. No action needed for you.

Kind regards
Uffe

> > ---
> >  drivers/mmc/host/sdhci-omap.c | 9 +++------
> >  1 file changed, 3 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c
> > --- a/drivers/mmc/host/sdhci-omap.c
> > +++ b/drivers/mmc/host/sdhci-omap.c
> > @@ -1210,8 +1210,6 @@ static const struct soc_device_attribute sdhci_omap_soc_devices[] = {
> >         }
> >  };
> >
> > -static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host);
> > -
> >  static int sdhci_omap_probe(struct platform_device *pdev)
> >  {
> >         int ret;
> > @@ -1417,8 +1415,8 @@ static int sdhci_omap_remove(struct platform_device *pdev)
> >
> >         return 0;
> >  }
> > -#ifdef CONFIG_PM_SLEEP
>
> This above should be:
> #ifdef CONFIG_PM
>
> sdhci_runtime_suspend|resume() host is defined like this as well, so
> the below would trigger a compiler error when built with CONFIG_PM
> unset.
>
> > -static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
> > +
> > +static void __maybe_unused sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
> >  {
> >         omap_host->con = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON);
> >         omap_host->hctl = sdhci_omap_readl(omap_host, SDHCI_OMAP_HCTL);
> > @@ -1429,7 +1427,7 @@ static void sdhci_omap_context_save(struct sdhci_omap_host *omap_host)
> >  }
> >
> >  /* Order matters here, HCTL must be restored in two phases */
> > -static void sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
> > +static void __maybe_unused sdhci_omap_context_restore(struct sdhci_omap_host *omap_host)
> >  {
> >         sdhci_omap_writel(omap_host, SDHCI_OMAP_HCTL, omap_host->hctl);
> >         sdhci_omap_writel(omap_host, SDHCI_OMAP_CAPA, omap_host->capa);
> > @@ -1471,7 +1469,6 @@ static int __maybe_unused sdhci_omap_runtime_resume(struct device *dev)
> >
> >         return 0;
> >  }
> > -#endif
> >
> >  static const struct dev_pm_ops sdhci_omap_dev_pm_ops = {
> >         SET_RUNTIME_PM_OPS(sdhci_omap_runtime_suspend,
>
> Kind regards
> Uffe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-21 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 13:43 [PATCH] mmc: sdhci-omap: Fix build if CONFIG_PM_SLEEP is not set Tony Lindgren
2021-10-21 19:34 ` Ulf Hansson
2021-10-21 19:49   ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).