Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: cs48l32: Use modern PM_OPS

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>
Reviewed-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250418-cs48l32-modern-pm_ops-v1-1-640559407619@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Nathan Chancellor and committed by
Mark Brown
6070ef6e 7603b144

+2 -2
+2 -2
sound/soc/codecs/cs48l32.c
··· 3834 3834 } 3835 3835 3836 3836 static const struct dev_pm_ops cs48l32_pm_ops = { 3837 - SET_RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL) 3837 + RUNTIME_PM_OPS(cs48l32_runtime_suspend, cs48l32_runtime_resume, NULL) 3838 3838 }; 3839 3839 3840 3840 static int cs48l32_configure_clk32k(struct cs48l32 *cs48l32) ··· 4057 4057 static struct spi_driver cs48l32_spi_driver = { 4058 4058 .driver = { 4059 4059 .name = "cs48l32", 4060 - .pm = &cs48l32_pm_ops, 4060 + .pm = pm_ptr(&cs48l32_pm_ops), 4061 4061 .of_match_table = cs48l32_of_match, 4062 4062 }, 4063 4063 .probe = &cs48l32_spi_probe,