ASoC: fsl: Convert to RUNTIME_PM_OPS() and co
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:21 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:39 +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()

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: Shengjiu Wang <shengjiu.wang@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250317095603.20073-60-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_aud2htx.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_micfil.c
sound/soc/fsl/fsl_sai.c
sound/soc/fsl/fsl_xcvr.c

index bde6423188356dcf19dcac80f2b073a75c46bfb8..da401561e2debfcb2f873ad78da08238d15a985f 100644 (file)
@@ -290,8 +290,7 @@ static int fsl_aud2htx_runtime_resume(struct device *dev)
 static const struct dev_pm_ops fsl_aud2htx_pm_ops = {
        RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, fsl_aud2htx_runtime_resume,
                       NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_aud2htx_driver = {
index 0b247f16a163fa0e114987fcdf293b73073aaf58..cde0b0c6c1ef90554c9662e86cb4db26351a2cae 100644 (file)
@@ -1189,11 +1189,8 @@ static int fsl_esai_runtime_suspend(struct device *dev)
 }
 
 static const struct dev_pm_ops fsl_esai_pm_ops = {
-       SET_RUNTIME_PM_OPS(fsl_esai_runtime_suspend,
-                          fsl_esai_runtime_resume,
-                          NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       RUNTIME_PM_OPS(fsl_esai_runtime_suspend, fsl_esai_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_esai_driver = {
@@ -1201,7 +1198,7 @@ static struct platform_driver fsl_esai_driver = {
        .remove = fsl_esai_remove,
        .driver = {
                .name = "fsl-esai-dai",
-               .pm = &fsl_esai_pm_ops,
+               .pm = pm_ptr(&fsl_esai_pm_ops),
                .of_match_table = fsl_esai_dt_ids,
        },
 };
index 73d8910a61887430dcc646e8e0d858b163362fd2..aabd90a8b3eca9748892e90f426d322863106559 100644 (file)
@@ -1512,11 +1512,8 @@ static int fsl_micfil_runtime_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops fsl_micfil_pm_ops = {
-       SET_RUNTIME_PM_OPS(fsl_micfil_runtime_suspend,
-                          fsl_micfil_runtime_resume,
-                          NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       RUNTIME_PM_OPS(fsl_micfil_runtime_suspend, fsl_micfil_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_micfil_driver = {
@@ -1524,7 +1521,7 @@ static struct platform_driver fsl_micfil_driver = {
        .remove = fsl_micfil_remove,
        .driver = {
                .name = "fsl-micfil-dai",
-               .pm = &fsl_micfil_pm_ops,
+               .pm = pm_ptr(&fsl_micfil_pm_ops),
                .of_match_table = fsl_micfil_dt_ids,
        },
 };
index 9f33dd11d47f64c96b4dad22be38573173628690..ed2b4780c4707929d466c1ef8224e09aadaed679 100644 (file)
@@ -1817,10 +1817,8 @@ disable_bus_clk:
 }
 
 static const struct dev_pm_ops fsl_sai_pm_ops = {
-       SET_RUNTIME_PM_OPS(fsl_sai_runtime_suspend,
-                          fsl_sai_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       RUNTIME_PM_OPS(fsl_sai_runtime_suspend, fsl_sai_runtime_resume, NULL)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_sai_driver = {
@@ -1828,7 +1826,7 @@ static struct platform_driver fsl_sai_driver = {
        .remove = fsl_sai_remove,
        .driver = {
                .name = "fsl-sai",
-               .pm = &fsl_sai_pm_ops,
+               .pm = pm_ptr(&fsl_sai_pm_ops),
                .of_match_table = fsl_sai_ids,
        },
 };
index c59c1af5a98a7750afd583dab8e70da5d420ea6e..83aea341c1b6099ae367e72ac3350fd5b2bb6109 100644 (file)
@@ -1821,8 +1821,7 @@ stop_ipg_clk:
 
 static const struct dev_pm_ops fsl_xcvr_pm_ops = {
        RUNTIME_PM_OPS(fsl_xcvr_runtime_suspend, fsl_xcvr_runtime_resume, NULL)
-       SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
-                               pm_runtime_force_resume)
+       SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
 };
 
 static struct platform_driver fsl_xcvr_driver = {