diff options
author | Takashi Iwai <tiwai@suse.de> | 2025-03-17 10:54:26 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2025-03-17 10:13:50 +0000 |
commit | 5ef209dcdc3fe8f9661a80af4c8ed7a2326c9206 (patch) | |
tree | 5f00eb45cc98cde0c3bda9ad88564b28e6e7f65a | |
parent | 9f9c8e9064ea8ceb13540a283f08550c097bb673 (diff) |
ASoC: ak5558: Convert to RUNTIME_PM_OPS() & co
Use the newer RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() macros
instead of SET_RUNTIME_PM_OPS() and SET_SYSTEM_SLEEP_PM_OPS() together
with pm_ptr(), which allows us dropping ugly __maybe_unused
attributes.
This optimizes slightly when CONFIG_PM is disabled, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-5-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/ak5558.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sound/soc/codecs/ak5558.c b/sound/soc/codecs/ak5558.c index 6c767609f95d..683f3e472f50 100644 --- a/sound/soc/codecs/ak5558.c +++ b/sound/soc/codecs/ak5558.c @@ -342,7 +342,7 @@ static void ak5558_remove(struct snd_soc_component *component) ak5558_reset(ak5558, true); } -static int __maybe_unused ak5558_runtime_suspend(struct device *dev) +static int ak5558_runtime_suspend(struct device *dev) { struct ak5558_priv *ak5558 = dev_get_drvdata(dev); @@ -354,7 +354,7 @@ static int __maybe_unused ak5558_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused ak5558_runtime_resume(struct device *dev) +static int ak5558_runtime_resume(struct device *dev) { struct ak5558_priv *ak5558 = dev_get_drvdata(dev); int ret; @@ -376,9 +376,8 @@ static int __maybe_unused ak5558_runtime_resume(struct device *dev) } static const struct dev_pm_ops ak5558_pm = { - SET_RUNTIME_PM_OPS(ak5558_runtime_suspend, ak5558_runtime_resume, NULL) - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) + RUNTIME_PM_OPS(ak5558_runtime_suspend, ak5558_runtime_resume, NULL) + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) }; static const struct snd_soc_component_driver soc_codec_dev_ak5558 = { @@ -495,7 +494,7 @@ static struct i2c_driver ak5558_i2c_driver = { .driver = { .name = "ak5558", .of_match_table = of_match_ptr(ak5558_i2c_dt_ids), - .pm = &ak5558_pm, + .pm = pm_ptr(&ak5558_pm), }, .probe = ak5558_i2c_probe, .remove = ak5558_i2c_remove, |