summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2025-03-17 10:54:35 +0100
committerMark Brown <broonie@kernel.org>2025-03-17 10:13:58 +0000
commit9a1d4a56565161a8bbf5b2a9d92665010303aeac (patch)
treec567e79846f6ba64a885b4d39d5d2cfc6dbf4be1
parent7b7e2292e0ba84515e62147a47b79e1f81f47b1c (diff)
ASoC: cs43130: Convert to RUNTIME_PM_OPS()
Use the newer RUNTIME_PM_OPS() macro instead of SET_RUNTIME_PM_OPS() together with pm_ptr(), which allows us dropping ugly __maybe_unused attributes. This optimizes slightly when CONFIG_PM is disabled, too. Cc: patches@opensource.cirrus.com Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://patch.msgid.link/20250317095603.20073-14-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/codecs/cs43130.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index cd535be0b4ba..d9b3d73c8388 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -2672,7 +2672,7 @@ static void cs43130_i2c_remove(struct i2c_client *client)
regulator_bulk_disable(CS43130_NUM_SUPPLIES, cs43130->supplies);
}
-static int __maybe_unused cs43130_runtime_suspend(struct device *dev)
+static int cs43130_runtime_suspend(struct device *dev)
{
struct cs43130_private *cs43130 = dev_get_drvdata(dev);
@@ -2691,7 +2691,7 @@ static int __maybe_unused cs43130_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused cs43130_runtime_resume(struct device *dev)
+static int cs43130_runtime_resume(struct device *dev)
{
struct cs43130_private *cs43130 = dev_get_drvdata(dev);
int ret;
@@ -2727,8 +2727,7 @@ err:
}
static const struct dev_pm_ops cs43130_runtime_pm = {
- SET_RUNTIME_PM_OPS(cs43130_runtime_suspend, cs43130_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(cs43130_runtime_suspend, cs43130_runtime_resume, NULL)
};
#if IS_ENABLED(CONFIG_OF)
@@ -2768,7 +2767,7 @@ static struct i2c_driver cs43130_i2c_driver = {
.name = "cs43130",
.of_match_table = of_match_ptr(cs43130_of_match),
.acpi_match_table = ACPI_PTR(cs43130_acpi_match),
- .pm = &cs43130_runtime_pm,
+ .pm = pm_ptr(&cs43130_runtime_pm),
},
.id_table = cs43130_i2c_id,
.probe = cs43130_i2c_probe,