All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: mmp2: fix build without CONFIG_PM
@ 2021-01-03 13:54 Arnd Bergmann
  2021-01-05 12:17 ` Lubomir Rintel
  2021-01-12 19:32 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-01-03 13:54 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Lubomir Rintel
  Cc: Arnd Bergmann, linux-clk, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

pm_clk_suspend()/pm_clk_resume() are defined as NULL pointers rather than
empty inline stubs without CONFIG_PM:

drivers/clk/mmp/clk-audio.c:402:16: error: called object type 'void *' is not a function or function pointer
        pm_clk_suspend(dev);
drivers/clk/mmp/clk-audio.c:411:15: error: called object type 'void *' is not a function or function pointer
        pm_clk_resume(dev);

I tried redefining the helper functions, but that caused additional
problems. This is the simple solution of replacing the __maybe_unused
trick with an #ifdef.

Fixes: 725262d29139 ("clk: mmp2: Add audio clock controller driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/clk/mmp/clk-audio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/mmp/clk-audio.c b/drivers/clk/mmp/clk-audio.c
index eea69d498bd2..7aa7f4a9564f 100644
--- a/drivers/clk/mmp/clk-audio.c
+++ b/drivers/clk/mmp/clk-audio.c
@@ -392,7 +392,8 @@ static int mmp2_audio_clk_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
+#ifdef CONFIG_PM
+static int mmp2_audio_clk_suspend(struct device *dev)
 {
 	struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
 
@@ -404,7 +405,7 @@ static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
+static int mmp2_audio_clk_resume(struct device *dev)
 {
 	struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
 
@@ -415,6 +416,7 @@ static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
 
 	return 0;
 }
+#endif
 
 static const struct dev_pm_ops mmp2_audio_clk_pm_ops = {
 	SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)
-- 
2.29.2


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

* Re: [PATCH] clk: mmp2: fix build without CONFIG_PM
  2021-01-03 13:54 [PATCH] clk: mmp2: fix build without CONFIG_PM Arnd Bergmann
@ 2021-01-05 12:17 ` Lubomir Rintel
  2021-01-12 19:32 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Lubomir Rintel @ 2021-01-05 12:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Michael Turquette, Stephen Boyd, Arnd Bergmann, linux-clk, linux-kernel

On Sun, Jan 03, 2021 at 02:54:53PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> pm_clk_suspend()/pm_clk_resume() are defined as NULL pointers rather than
> empty inline stubs without CONFIG_PM:
> 
> drivers/clk/mmp/clk-audio.c:402:16: error: called object type 'void *' is not a function or function pointer
>         pm_clk_suspend(dev);
> drivers/clk/mmp/clk-audio.c:411:15: error: called object type 'void *' is not a function or function pointer
>         pm_clk_resume(dev);
> 
> I tried redefining the helper functions, but that caused additional
> problems. This is the simple solution of replacing the __maybe_unused
> trick with an #ifdef.
> 
> Fixes: 725262d29139 ("clk: mmp2: Add audio clock controller driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thank you.

Acked-By: Lubomir Rintel <lkundrak@v3.sk>

> ---
>  drivers/clk/mmp/clk-audio.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/mmp/clk-audio.c b/drivers/clk/mmp/clk-audio.c
> index eea69d498bd2..7aa7f4a9564f 100644
> --- a/drivers/clk/mmp/clk-audio.c
> +++ b/drivers/clk/mmp/clk-audio.c
> @@ -392,7 +392,8 @@ static int mmp2_audio_clk_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> -static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
> +#ifdef CONFIG_PM
> +static int mmp2_audio_clk_suspend(struct device *dev)
>  {
>  	struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
>  
> @@ -404,7 +405,7 @@ static int __maybe_unused mmp2_audio_clk_suspend(struct device *dev)
>  	return 0;
>  }
>  
> -static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
> +static int mmp2_audio_clk_resume(struct device *dev)
>  {
>  	struct mmp2_audio_clk *priv = dev_get_drvdata(dev);
>  
> @@ -415,6 +416,7 @@ static int __maybe_unused mmp2_audio_clk_resume(struct device *dev)
>  
>  	return 0;
>  }
> +#endif
>  
>  static const struct dev_pm_ops mmp2_audio_clk_pm_ops = {
>  	SET_RUNTIME_PM_OPS(mmp2_audio_clk_suspend, mmp2_audio_clk_resume, NULL)
> -- 
> 2.29.2
> 

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

* Re: [PATCH] clk: mmp2: fix build without CONFIG_PM
  2021-01-03 13:54 [PATCH] clk: mmp2: fix build without CONFIG_PM Arnd Bergmann
  2021-01-05 12:17 ` Lubomir Rintel
@ 2021-01-12 19:32 ` Stephen Boyd
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2021-01-12 19:32 UTC (permalink / raw)
  To: Arnd Bergmann, Lubomir Rintel, Michael Turquette
  Cc: Arnd Bergmann, linux-clk, linux-kernel

Quoting Arnd Bergmann (2021-01-03 05:54:53)
> From: Arnd Bergmann <arnd@arndb.de>
> 
> pm_clk_suspend()/pm_clk_resume() are defined as NULL pointers rather than
> empty inline stubs without CONFIG_PM:
> 
> drivers/clk/mmp/clk-audio.c:402:16: error: called object type 'void *' is not a function or function pointer
>         pm_clk_suspend(dev);
> drivers/clk/mmp/clk-audio.c:411:15: error: called object type 'void *' is not a function or function pointer
>         pm_clk_resume(dev);
> 
> I tried redefining the helper functions, but that caused additional
> problems. This is the simple solution of replacing the __maybe_unused
> trick with an #ifdef.
> 
> Fixes: 725262d29139 ("clk: mmp2: Add audio clock controller driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Applied to clk-fixes

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

end of thread, other threads:[~2021-01-12 19:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-03 13:54 [PATCH] clk: mmp2: fix build without CONFIG_PM Arnd Bergmann
2021-01-05 12:17 ` Lubomir Rintel
2021-01-12 19:32 ` Stephen Boyd

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.