aboutsummaryrefslogtreecommitdiffstats
diff options
authorTakashi Iwai <tiwai@suse.de>2025-03-17 10:55:34 +0100
committerMark Brown <broonie@kernel.org>2025-03-17 10:14:51 +0000
commitbd8540105e88581bdf27a9a92231907a9168d0b6 (patch)
tree28e30fbe6eda7cee0179da01bd25380a3edd7ba9
parent951f082eb09b50d68b8271257777f206ee3001a8 (diff)
downloadath-bd8540105e88581bdf27a9a92231907a9168d0b6.tar.gz
ASoC: mediatek: mt8365: 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 to drop 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-73-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/mediatek/mt8365/mt8365-afe-pcm.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
index 743b465721441..10793bbe9275d 100644
--- a/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
+++ b/sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
@@ -1957,7 +1957,7 @@ err_irq:
return IRQ_HANDLED;
}
-static int __maybe_unused mt8365_afe_runtime_suspend(struct device *dev)
+static int mt8365_afe_runtime_suspend(struct device *dev)
{
return 0;
}
@@ -1967,7 +1967,7 @@ static int mt8365_afe_runtime_resume(struct device *dev)
return 0;
}
-static int __maybe_unused mt8365_afe_suspend(struct device *dev)
+static int mt8365_afe_suspend(struct device *dev)
{
struct mtk_base_afe *afe = dev_get_drvdata(dev);
struct regmap *regmap = afe->regmap;
@@ -1989,7 +1989,7 @@ static int __maybe_unused mt8365_afe_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused mt8365_afe_resume(struct device *dev)
+static int mt8365_afe_resume(struct device *dev)
{
struct mtk_base_afe *afe = dev_get_drvdata(dev);
struct regmap *regmap = afe->regmap;
@@ -2009,7 +2009,7 @@ static int __maybe_unused mt8365_afe_resume(struct device *dev)
return 0;
}
-static int __maybe_unused mt8365_afe_dev_runtime_suspend(struct device *dev)
+static int mt8365_afe_dev_runtime_suspend(struct device *dev)
{
struct mtk_base_afe *afe = dev_get_drvdata(dev);
@@ -2021,7 +2021,7 @@ static int __maybe_unused mt8365_afe_dev_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused mt8365_afe_dev_runtime_resume(struct device *dev)
+static int mt8365_afe_dev_runtime_resume(struct device *dev)
{
struct mtk_base_afe *afe = dev_get_drvdata(dev);
@@ -2250,17 +2250,16 @@ static const struct of_device_id mt8365_afe_pcm_dt_match[] = {
MODULE_DEVICE_TABLE(of, mt8365_afe_pcm_dt_match);
static const struct dev_pm_ops mt8365_afe_pm_ops = {
- SET_RUNTIME_PM_OPS(mt8365_afe_dev_runtime_suspend,
- mt8365_afe_dev_runtime_resume, NULL)
- SET_SYSTEM_SLEEP_PM_OPS(mt8365_afe_suspend,
- mt8365_afe_resume)
+ RUNTIME_PM_OPS(mt8365_afe_dev_runtime_suspend,
+ mt8365_afe_dev_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(mt8365_afe_suspend, mt8365_afe_resume)
};
static struct platform_driver mt8365_afe_pcm_driver = {
.driver = {
.name = "mt8365-afe-pcm",
.of_match_table = mt8365_afe_pcm_dt_match,
- .pm = &mt8365_afe_pm_ops,
+ .pm = pm_ptr(&mt8365_afe_pm_ops),
},
.probe = mt8365_afe_pcm_dev_probe,
.remove = mt8365_afe_pcm_dev_remove,