mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs48l32: Use modern PM_OPS
@ 2025-04-18 20:36 Nathan Chancellor
  2025-04-19  9:58 ` Richard Fitzgerald
  2025-04-22 13:12 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2025-04-18 20:36 UTC (permalink / raw)
  To: David Rhodes, Richard Fitzgerald, Mark Brown
  Cc: Stuart Henderson, Qi Zhou, Piotr Stankiewicz, linux-sound,
	patches, linux-kernel, Nathan Chancellor

When building for a platform that does not support CONFIG_PM, such as
s390, cs48l32_runtime_{suspend,resume}() are unused because
SET_RUNTIME_PM_OPS does not reference its argument when CONFIG_PM is not
set:

  sound/soc/codecs/cs48l32.c:3822:12: error: 'cs48l32_runtime_suspend' defined but not used [-Werror=unused-function]
   3822 | static int cs48l32_runtime_suspend(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~~
  sound/soc/codecs/cs48l32.c:3779:12: error: 'cs48l32_runtime_resume' defined but not used [-Werror=unused-function]
   3779 | static int cs48l32_runtime_resume(struct device *dev)
        |            ^~~~~~~~~~~~~~~~~~~~~~
  cc1: all warnings being treated as errors

Use RUNTIME_PM_OPS and pm_ptr() to ensure these functions are seen as
used by the compiler but be dropped in the final object file when
CONFIG_PM is not set, matching the current behavior while clearing up
the warnings.

Fixes: e2bcbf99d045 ("ASoC: cs48l32: Add driver for Cirrus Logic CS48L32 audio DSP")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 sound/soc/codecs/cs48l32.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/cs48l32.c b/sound/soc/codecs/cs48l32.c
index 8fd0df671730..90a795230d27 100644
--- a/sound/soc/codecs/cs48l32.c
+++ b/sound/soc/codecs/cs48l32.c
@@ -3834,7 +3834,7 @@ static int cs48l32_runtime_suspend(struct device *dev)
 }
 
 static const struct dev_pm_ops cs48l32_pm_ops = {
-	SET_RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL)
+	RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL)
 };
 
 static int cs48l32_configure_clk32k(struct cs48l32 *cs48l32)
@@ -4057,7 +4057,7 @@ MODULE_DEVICE_TABLE(spi, cs48l32_spi_ids);
 static struct spi_driver cs48l32_spi_driver = {
 	.driver = {
 		.name		= "cs48l32",
-		.pm		= &cs48l32_pm_ops,
+		.pm		= pm_ptr(&cs48l32_pm_ops),
 		.of_match_table	= cs48l32_of_match,
 	},
 	.probe		= &cs48l32_spi_probe,

---
base-commit: 0b0a18f1bd72c64ae845a32d975f6d4c727b38e3
change-id: 20250418-cs48l32-modern-pm_ops-3e4b5860e366

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


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

* Re: [PATCH] ASoC: cs48l32: Use modern PM_OPS
  2025-04-18 20:36 [PATCH] ASoC: cs48l32: Use modern PM_OPS Nathan Chancellor
@ 2025-04-19  9:58 ` Richard Fitzgerald
  2025-04-22 13:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2025-04-19  9:58 UTC (permalink / raw)
  To: Nathan Chancellor, David Rhodes, Mark Brown
  Cc: Stuart Henderson, Qi Zhou, Piotr Stankiewicz, linux-sound,
	patches, linux-kernel

On 18/4/25 21:36, Nathan Chancellor wrote:
> When building for a platform that does not support CONFIG_PM, such as
> s390, cs48l32_runtime_{suspend,resume}() are unused because
> SET_RUNTIME_PM_OPS does not reference its argument when CONFIG_PM is not
> set:
> 
>    sound/soc/codecs/cs48l32.c:3822:12: error: 'cs48l32_runtime_suspend' defined but not used [-Werror=unused-function]
>     3822 | static int cs48l32_runtime_suspend(struct device *dev)
>          |            ^~~~~~~~~~~~~~~~~~~~~~~
>    sound/soc/codecs/cs48l32.c:3779:12: error: 'cs48l32_runtime_resume' defined but not used [-Werror=unused-function]
>     3779 | static int cs48l32_runtime_resume(struct device *dev)
>          |            ^~~~~~~~~~~~~~~~~~~~~~
>    cc1: all warnings being treated as errors
> 
> Use RUNTIME_PM_OPS and pm_ptr() to ensure these functions are seen as
> used by the compiler but be dropped in the final object file when
> CONFIG_PM is not set, matching the current behavior while clearing up
> the warnings.
> 
> Fixes: e2bcbf99d045 ("ASoC: cs48l32: Add driver for Cirrus Logic CS48L32 audio DSP")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>   sound/soc/codecs/cs48l32.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/sound/soc/codecs/cs48l32.c b/sound/soc/codecs/cs48l32.c
> index 8fd0df671730..90a795230d27 100644
> --- a/sound/soc/codecs/cs48l32.c
> +++ b/sound/soc/codecs/cs48l32.c
> @@ -3834,7 +3834,7 @@ static int cs48l32_runtime_suspend(struct device *dev)
>   }
>   
>   static const struct dev_pm_ops cs48l32_pm_ops = {
> -	SET_RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL)
> +	RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL)
>   };
>   
>   static int cs48l32_configure_clk32k(struct cs48l32 *cs48l32)
> @@ -4057,7 +4057,7 @@ MODULE_DEVICE_TABLE(spi, cs48l32_spi_ids);
>   static struct spi_driver cs48l32_spi_driver = {
>   	.driver = {
>   		.name		= "cs48l32",
> -		.pm		= &cs48l32_pm_ops,
> +		.pm		= pm_ptr(&cs48l32_pm_ops),
>   		.of_match_table	= cs48l32_of_match,
>   	},
>   	.probe		= &cs48l32_spi_probe,
> 
> ---
> base-commit: 0b0a18f1bd72c64ae845a32d975f6d4c727b38e3
> change-id: 20250418-cs48l32-modern-pm_ops-3e4b5860e366
> 
> Best regards,

Thanks.
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>

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

* Re: [PATCH] ASoC: cs48l32: Use modern PM_OPS
  2025-04-18 20:36 [PATCH] ASoC: cs48l32: Use modern PM_OPS Nathan Chancellor
  2025-04-19  9:58 ` Richard Fitzgerald
@ 2025-04-22 13:12 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-04-22 13:12 UTC (permalink / raw)
  To: David Rhodes, Richard Fitzgerald, Nathan Chancellor
  Cc: Stuart Henderson, Qi Zhou, Piotr Stankiewicz, linux-sound,
	patches, linux-kernel

On Fri, 18 Apr 2025 16:36:01 -0400, Nathan Chancellor wrote:
> When building for a platform that does not support CONFIG_PM, such as
> s390, cs48l32_runtime_{suspend,resume}() are unused because
> SET_RUNTIME_PM_OPS does not reference its argument when CONFIG_PM is not
> set:
> 
>   sound/soc/codecs/cs48l32.c:3822:12: error: 'cs48l32_runtime_suspend' defined but not used [-Werror=unused-function]
>    3822 | static int cs48l32_runtime_suspend(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~~~
>   sound/soc/codecs/cs48l32.c:3779:12: error: 'cs48l32_runtime_resume' defined but not used [-Werror=unused-function]
>    3779 | static int cs48l32_runtime_resume(struct device *dev)
>         |            ^~~~~~~~~~~~~~~~~~~~~~
>   cc1: all warnings being treated as errors
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs48l32: Use modern PM_OPS
      commit: 6070ef6e4202dae61027c146d797319b9e5c07b3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2025-04-22 13:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-18 20:36 [PATCH] ASoC: cs48l32: Use modern PM_OPS Nathan Chancellor
2025-04-19  9:58 ` Richard Fitzgerald
2025-04-22 13:12 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®