ASoC: wm8994: Convert to SYSTEM_SLEEP_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:16 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:34 +0000 (10:14 +0000)
Use the newer SYSTEM_SLEEP_PM_OPS() macro instead of
SET_SYSTEM_SLEEP_PM_OPS() together with pm_ptr(), which allows us
superfluous CONFIG_PM_SLEEP ifdefs.

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-55-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/wm8994.c

index 69a22992c2812d062aea3f6eb226edf2bb38c026..240ec1bed23470884d2cb55249272f9e7f7f2d48 100644 (file)
@@ -4662,7 +4662,6 @@ static void wm8994_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 }
 
-#ifdef CONFIG_PM_SLEEP
 static int wm8994_suspend(struct device *dev)
 {
        struct wm8994_priv *wm8994 = dev_get_drvdata(dev);
@@ -4687,16 +4686,15 @@ static int wm8994_resume(struct device *dev)
 
        return 0;
 }
-#endif
 
 static const struct dev_pm_ops wm8994_pm_ops = {
-       SET_SYSTEM_SLEEP_PM_OPS(wm8994_suspend, wm8994_resume)
+       SYSTEM_SLEEP_PM_OPS(wm8994_suspend, wm8994_resume)
 };
 
 static struct platform_driver wm8994_codec_driver = {
        .driver = {
                .name = "wm8994-codec",
-               .pm = &wm8994_pm_ops,
+               .pm = pm_ptr(&wm8994_pm_ops),
        },
        .probe = wm8994_probe,
        .remove = wm8994_remove,