From: Richard Fitzgerald <rf@opensource.cirrus.com>
To: broonie@kernel.org
Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@opensource.cirrus.com
Subject: [PATCH] ASoC: cs35l56: Use RUNTIME_PM_OPS() instead of SET_RUNTIME_PM_OPS()
Date: Fri, 4 Dec 2026 13:08:27 +0000 [thread overview]
Message-ID: <20261204130827.2363478-1-rf@opensource.cirrus.com> (raw)
Use the newer RUNTIME_PM_OPS() macro so we can remove all the
__maybe_unused attributes on the functions.
Also remove the #if conditional around the cs35l56_pm_ops_i2c_spi
instantiation, because this was requiring a couple of the __maybe_unused.
The conditional was to allow dropping the PM functions for I2C/SPI if the
driver was built without I2C/SPI support. But the size of code and data
removed by the #if was trivial, and standard downstream distro kernels
include the I2C/SPI support.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/soc/codecs/cs35l56-sdw.c | 10 +++++-----
sound/soc/codecs/cs35l56.c | 8 +++-----
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/cs35l56-sdw.c b/sound/soc/codecs/cs35l56-sdw.c
index 770a5fcd843f..f53797f89479 100644
--- a/sound/soc/codecs/cs35l56-sdw.c
+++ b/sound/soc/codecs/cs35l56-sdw.c
@@ -337,7 +337,7 @@ static const struct sdw_slave_ops cs35l56_sdw_ops = {
.update_status = cs35l56_sdw_update_status,
};
-static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs35l56)
+static int cs35l56_sdw_handle_unattach(struct cs35l56_private *cs35l56)
{
struct sdw_slave *peripheral = cs35l56->sdw_peripheral;
int ret;
@@ -358,7 +358,7 @@ static int __maybe_unused cs35l56_sdw_handle_unattach(struct cs35l56_private *cs
return 0;
}
-static int __maybe_unused cs35l56_sdw_runtime_suspend(struct device *dev)
+static int cs35l56_sdw_runtime_suspend(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
@@ -368,7 +368,7 @@ static int __maybe_unused cs35l56_sdw_runtime_suspend(struct device *dev)
return cs35l56_runtime_suspend_common(&cs35l56->base);
}
-static int __maybe_unused cs35l56_sdw_runtime_resume(struct device *dev)
+static int cs35l56_sdw_runtime_resume(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
int ret;
@@ -398,7 +398,7 @@ static int cs35l56_sdw_system_suspend_prepare(struct device *dev)
return 0;
}
-static int __maybe_unused cs35l56_sdw_system_suspend(struct device *dev)
+static int cs35l56_sdw_system_suspend(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
int ret;
@@ -485,7 +485,7 @@ static void cs35l56_sdw_remove(struct sdw_slave *peripheral)
static const struct dev_pm_ops cs35l56_sdw_pm = {
.prepare = cs35l56_sdw_system_suspend_prepare,
- SET_RUNTIME_PM_OPS(cs35l56_sdw_runtime_suspend, cs35l56_sdw_runtime_resume, NULL)
+ RUNTIME_PM_OPS(cs35l56_sdw_runtime_suspend, cs35l56_sdw_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(cs35l56_sdw_system_suspend, cs35l56_system_resume)
LATE_SYSTEM_SLEEP_PM_OPS(cs35l56_system_suspend_late, cs35l56_system_resume_early)
/* NOIRQ stage not needed, SoundWire doesn't use a hard IRQ */
diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c
index 34588245a8f3..6be0e7eb23d7 100644
--- a/sound/soc/codecs/cs35l56.c
+++ b/sound/soc/codecs/cs35l56.c
@@ -1614,14 +1614,14 @@ static const struct snd_soc_component_driver soc_component_dev_cs35l56 = {
.suspend_bias_off = 1, /* see cs35l56_system_resume() */
};
-static int __maybe_unused cs35l56_runtime_suspend_i2c_spi(struct device *dev)
+static int cs35l56_runtime_suspend_i2c_spi(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
return cs35l56_runtime_suspend_common(&cs35l56->base);
}
-static int __maybe_unused cs35l56_runtime_resume_i2c_spi(struct device *dev)
+static int cs35l56_runtime_resume_i2c_spi(struct device *dev)
{
struct cs35l56_private *cs35l56 = dev_get_drvdata(dev);
@@ -2436,14 +2436,12 @@ void cs35l56_remove(struct cs35l56_private *cs35l56)
}
EXPORT_SYMBOL_NS_GPL(cs35l56_remove, "SND_SOC_CS35L56_CORE");
-#if IS_ENABLED(CONFIG_SND_SOC_CS35L56_I2C) || IS_ENABLED(CONFIG_SND_SOC_CS35L56_SPI)
EXPORT_NS_GPL_DEV_PM_OPS(cs35l56_pm_ops_i2c_spi, SND_SOC_CS35L56_CORE) = {
- SET_RUNTIME_PM_OPS(cs35l56_runtime_suspend_i2c_spi, cs35l56_runtime_resume_i2c_spi, NULL)
+ RUNTIME_PM_OPS(cs35l56_runtime_suspend_i2c_spi, cs35l56_runtime_resume_i2c_spi, NULL)
SYSTEM_SLEEP_PM_OPS(cs35l56_system_suspend, cs35l56_system_resume)
LATE_SYSTEM_SLEEP_PM_OPS(cs35l56_system_suspend_late, cs35l56_system_resume_early)
NOIRQ_SYSTEM_SLEEP_PM_OPS(cs35l56_system_suspend_no_irq, cs35l56_system_resume_no_irq)
};
-#endif
static int cs35l56_reboot_notify(struct notifier_block *nb,
unsigned long action, void *data)
--
2.47.3
reply other threads:[~2026-12-04 13:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204130827.2363478-1-rf@opensource.cirrus.com \
--to=rf@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®