ASoC: fsl: fsl_aud2htx: Switch to RUNTIME_PM_OPS()
Subsystems (3)
Fabio Estevam
reviewerPATCH 1/3 ASoC: fsl: fsl_aud2htx: Switch to RUNTIME_PM_OPS()
From: Fabio Estevam <[email protected]>
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.
--- sound/soc/fsl/fsl_aud2htx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
sound/soc/fsl/fsl_aud2htx.c +5 -6
@@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev)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);
@@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev)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);int ret;
@@ -288,9 +288,8 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) }static const struct dev_pm_ops fsl_aud2htx_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, - fsl_aud2htx_runtime_resume, - NULL) + 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) };
@@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = { .remove_new = fsl_aud2htx_remove, .driver = { .name = "fsl-aud2htx", - .pm = &fsl_aud2htx_pm_ops, + .pm = pm_ptr(&fsl_aud2htx_pm_ops), .of_match_table = fsl_aud2htx_dt_ids, }, };
Signature · 1 line
2.34.1
Fabio Estevam
reviewerPATCH 2/3 ASoC: fsl: fsl_easrc: Switch to RUNTIME_PM_OPS()
From: Fabio Estevam <[email protected]>
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.
--- sound/soc/fsl/fsl_easrc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
sound/soc/fsl/fsl_easrc.c +4 -6
@@ -1988,7 +1988,7 @@ static void fsl_easrc_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -static __maybe_unused int fsl_easrc_runtime_suspend (struct device *dev) +static int fsl_easrc_runtime_suspend (struct device *dev) {struct fsl_asrc *easrc =dev_get_drvdata (dev);struct fsl_easrc_priv *easrc_priv = easrc->private;
@@ -2005,7 +2005,7 @@ static __maybe_unused int fsl_easrc_runtime_suspend(struct device *dev)return 0 ; } -static __maybe_unused int fsl_easrc_runtime_resume (struct device *dev) +static int fsl_easrc_runtime_resume (struct device *dev) {struct fsl_asrc *easrc =dev_get_drvdata (dev);struct fsl_easrc_priv *easrc_priv = easrc->private;
@@ -2086,9 +2086,7 @@ static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev) }static const struct dev_pm_ops fsl_easrc_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, - fsl_easrc_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, fsl_easrc_runtime_resume, NULL)SET_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, pm_runtime_force_resume) };
@@ -2098,7 +2096,7 @@ static struct platform_driver fsl_easrc_driver = { .remove_new = fsl_easrc_remove, .driver = { .name = "fsl-easrc", - .pm = &fsl_easrc_pm_ops, + .pm = pm_ptr(&fsl_easrc_pm_ops), .of_match_table = fsl_easrc_dt_ids, }, };
Signature · 1 line
2.34.1
Re: [PATCH 2/3] ASoC: fsl: fsl_easrc: Switch to RUNTIME_PM_OPS()
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Replace
SET_RUNTIME_PM_OPS()with its modern alternativeRUNTIME_PM_OPS().
Quoted 8 lines
The combined usage of
pm_ptr()andRUNTIME_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_unusednotation from the runtime suspend/resume() functions.Signed-off-by Fabio Estevam <[email protected]>
Best regards
Shengjiu Wang
Quoted 49 lines
--- sound/soc/fsl/fsl_easrc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)sound/soc/fsl/fsl_easrc.c +4
-7@@ -1988,7 +1988,7 @@ static void fsl_easrc_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -static __maybe_unused int fsl_easrc_runtime_suspend (struct device *dev) +static int fsl_easrc_runtime_suspend (struct device *dev) {struct fsl_asrc *easrc =dev_get_drvdata (dev);struct fsl_easrc_priv *easrc_priv = easrc->private;@@ -2005,7 +2005,7 @@ static __maybe_unused int fsl_easrc_runtime_suspend(struct device *dev)return 0 ; } -static __maybe_unused int fsl_easrc_runtime_resume (struct device *dev) +static int fsl_easrc_runtime_resume (struct device *dev) {struct fsl_asrc *easrc =dev_get_drvdata (dev);struct fsl_easrc_priv *easrc_priv = easrc->private;@@ -2086,9 +2086,7 @@ static __maybe_unused int fsl_easrc_runtime_resume(struct device *dev) }static const struct dev_pm_ops fsl_easrc_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, - fsl_easrc_runtime_resume, - NULL) + RUNTIME_PM_OPS(fsl_easrc_runtime_suspend, fsl_easrc_runtime_resume, NULL)SET_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, pm_runtime_force_resume) };@@ -2098,7 +2096,7 @@ static struct platform_driver fsl_easrc_driver = { .remove_new = fsl_easrc_remove, .driver = { .name = "fsl-easrc", - .pm = &fsl_easrc_pm_ops, + .pm = pm_ptr(&fsl_easrc_pm_ops), .of_match_table = fsl_easrc_dt_ids, }, }; --2.34.1
Fabio Estevam
reviewerPATCH 3/3 ASoC: fsl: fsl_xcvr: Switch to RUNTIME_PM_OPS()
In reply to Fabio EstevamFrom: Fabio Estevam <[email protected]>
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.
--- sound/soc/fsl/fsl_xcvr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
sound/soc/fsl/fsl_xcvr.c +4 -6
@@ -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 @@ static __maybe_unused int fsl_xcvr_runtime_resume(struct device *dev) }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,
Signature · 1 line
2.34.1
Re: [PATCH 3/3] ASoC: fsl: fsl_xcvr: Switch to RUNTIME_PM_OPS()
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Replace
SET_RUNTIME_PM_OPS()with its modern alternativeRUNTIME_PM_OPS().
Quoted 8 lines
The combined usage of
pm_ptr()andRUNTIME_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_unusednotation from the runtime suspend/resume() functions.Signed-off-by Fabio Estevam <[email protected]>
Best regards
Shengjiu Wang
Quoted 49 lines
--- sound/soc/fsl/fsl_xcvr.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)sound/soc/fsl/fsl_xcvr.c +4
-7@@ -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 @@ static __maybe_unused int fsl_xcvr_runtime_resume(struct device *dev) }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, --2.34.1
Quoted 5 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Replace
SET_RUNTIME_PM_OPS()with its modern alternativeRUNTIME_PM_OPS().
Quoted 8 lines
The combined usage of
pm_ptr()andRUNTIME_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_unusednotation from the runtime suspend/resume() functions.Signed-off-by Fabio Estevam <[email protected]>
Best regards
Shengjiu Wang
Quoted 50 lines
--- sound/soc/fsl/fsl_aud2htx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)sound/soc/fsl/fsl_aud2htx.c +5
-7@@ -261,7 +261,7 @@ static void fsl_aud2htx_remove(struct platform_device *pdev)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);@@ -271,7 +271,7 @@ static int __maybe_unused fsl_aud2htx_runtime_suspend(struct device *dev)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);int ret;@@ -288,9 +288,8 @@ static int __maybe_unused fsl_aud2htx_runtime_resume(struct device *dev) }static const struct dev_pm_ops fsl_aud2htx_pm_ops = { - SET_RUNTIME_PM_OPS(fsl_aud2htx_runtime_suspend, - fsl_aud2htx_runtime_resume, - NULL) + 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) };@@ -300,7 +299,7 @@ static struct platform_driver fsl_aud2htx_driver = { .remove_new = fsl_aud2htx_remove, .driver = { .name = "fsl-aud2htx", - .pm = &fsl_aud2htx_pm_ops, + .pm = pm_ptr(&fsl_aud2htx_pm_ops), .of_match_table = fsl_aud2htx_dt_ids, }, }; --2.34.1