]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: fsl: fsl_xcvr: Switch to RUNTIME_PM_OPS()
authorFabio Estevam <festevam@denx.de>
Tue, 7 May 2024 17:37:35 +0000 (14:37 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 27 May 2024 00:31:23 +0000 (01:31 +0100)
Replace SET_RUNTIME_PM_OPS() with its modern alternative RUNTIME_PM_OPS().

The combined usage of pm_ptr() and RUNTIME_PM_OPS() allows the
compiler to evaluate if the runtime suspend/resume() functions are used
at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Link: https://msgid.link/r/20240507173735.3456334-3-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_xcvr.c

index c46f64557a7ffd268716e852dfe4411251da08cc..5472ace23d820b3c72d418fdaa54719adde91697 100644 (file)
@@ -1364,7 +1364,7 @@ static void fsl_xcvr_remove(struct platform_device *pdev)
        pm_runtime_disable(&pdev->dev);
 }
 
-static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
+static int fsl_xcvr_runtime_suspend(struct device *dev)
 {
        struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
        int ret;
@@ -1398,7 +1398,7 @@ static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
        return 0;
 }
 
-static __maybe_unused int fsl_xcvr_runtime_resume(struct device *dev)
+static int fsl_xcvr_runtime_resume(struct device *dev)
 {
        struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
        int ret;
@@ -1483,9 +1483,7 @@ stop_ipg_clk:
 }
 
 static const struct dev_pm_ops fsl_xcvr_pm_ops = {
-       SET_RUNTIME_PM_OPS(fsl_xcvr_runtime_suspend,
-                          fsl_xcvr_runtime_resume,
-                          NULL)
+       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)
 };
@@ -1494,7 +1492,7 @@ static struct platform_driver fsl_xcvr_driver = {
        .probe = fsl_xcvr_probe,
        .driver = {
                .name = "fsl,imx8mp-audio-xcvr",
-               .pm = &fsl_xcvr_pm_ops,
+               .pm = pm_ptr(&fsl_xcvr_pm_ops),
                .of_match_table = fsl_xcvr_dt_ids,
        },
        .remove_new = fsl_xcvr_remove,