Commit 560495c0 authored by Fabio Estevam's avatar Fabio Estevam Committed by Mark Brown

ASoC: fsl: fsl_aud2htx: Switch to RUNTIME_PM_OPS()

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: default avatarFabio Estevam <festevam@denx.de>
Link: https://msgid.link/r/20240507173735.3456334-1-festevam@gmail.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8951ae0b
...@@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev) ...@@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
} }
static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev) static int fsl_aud2htx_runtime_suspend(struct device *dev)
{ {
struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev); struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev);
...@@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev) ...@@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) static int fsl_aud2htx_runtime_resume(struct device *dev)
{ {
struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev); struct fsl_aud2htx *aud2htx = dev_get_drvdata(dev);
int ret; int ret;
...@@ -288,8 +288,7 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) ...@@ -288,8 +288,7 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev)
} }
static const struct dev_pm_ops fsl_aud2htx_pm_ops = { static const struct dev_pm_ops fsl_aud2htx_pm_ops = {
SET_RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, fsl_aud2htx_runtime_resume,
fsl_aud2htx_runtime_resume,
NULL) NULL)
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
pm_runtime_force_resume) pm_runtime_force_resume)
...@@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = { ...@@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = {
.remove_new = fsl_aud2htx_remove, .remove_new = fsl_aud2htx_remove,
.driver = { .driver = {
.name = "fsl-aud2htx", .name = "fsl-aud2htx",
.pm = &fsl_aud2htx_pm_ops, .pm = pm_ptr(&fsl_aud2htx_pm_ops),
.of_match_table = fsl_aud2htx_dt_ids, .of_match_table = fsl_aud2htx_dt_ids,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment