summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Chancellor <nathan@kernel.org>2025-04-18 23:36:01 +0300
committerMark Brown <broonie@kernel.org>2025-04-21 19:22:15 +0300
commit6070ef6e4202dae61027c146d797319b9e5c07b3 (patch)
tree988389c7f6bc6a870104c125dfbd2d6242738ed9
parent7603b1443cbeba5a237067ababaf11095b5ba380 (diff)
downloadlinux-6070ef6e4202dae61027c146d797319b9e5c07b3.tar.xz
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>
-rw-r--r--sound/soc/codecs/cs48l32.c4
1 files 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,