]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: samsung: Convert to RUNTIME_PM_OPS() & co
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:38 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:54 +0000 (10:14 +0000)
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 superfluous CONFIG_PM ifdefs.

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-77-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/i2s.c

index 8f6deb06e23468bb7fda7cbe965c21e3207ed211..e9964f0e010aee549cced75d8fe2023e8271d443 100644 (file)
@@ -1216,7 +1216,6 @@ static int i2s_alloc_dais(struct samsung_i2s_priv *priv,
        return 0;
 }
 
-#ifdef CONFIG_PM
 static int i2s_runtime_suspend(struct device *dev)
 {
        struct samsung_i2s_priv *priv = dev_get_drvdata(dev);
@@ -1254,7 +1253,6 @@ static int i2s_runtime_resume(struct device *dev)
 
        return 0;
 }
-#endif /* CONFIG_PM */
 
 static void i2s_unregister_clocks(struct samsung_i2s_priv *priv)
 {
@@ -1733,10 +1731,8 @@ MODULE_DEVICE_TABLE(of, exynos_i2s_match);
 #endif
 
 static const struct dev_pm_ops samsung_i2s_pm = {
-       SET_RUNTIME_PM_OPS(i2s_runtime_suspend,
-                               i2s_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                                    pm_runtime_force_resume)
+       RUNTIME_PM_OPS(i2s_runtime_suspend, i2s_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver samsung_i2s_driver = {
@@ -1746,7 +1742,7 @@ static struct platform_driver samsung_i2s_driver = {
        .driver = {
                .name = "samsung-i2s",
                .of_match_table = of_match_ptr(exynos_i2s_match),
-               .pm = &samsung_i2s_pm,
+               .pm = pm_ptr(&samsung_i2s_pm),
        },
 };