* [PATCH 2/7] ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-08 18:49 ` [PATCH 3/7] ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS() Fabio Estevam
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.
The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_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 CONFIG_PM ifdefery from the runtime
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/fsl_mqs.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/sound/soc/fsl/fsl_mqs.c b/sound/soc/fsl/fsl_mqs.c
index c95b84a54dc4..df160834c81b 100644
--- a/sound/soc/fsl/fsl_mqs.c
+++ b/sound/soc/fsl/fsl_mqs.c
@@ -265,7 +265,6 @@ static void fsl_mqs_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-#ifdef CONFIG_PM
static int fsl_mqs_runtime_resume(struct device *dev)
{
struct fsl_mqs *mqs_priv = dev_get_drvdata(dev);
@@ -299,14 +298,10 @@ static int fsl_mqs_runtime_suspend(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops fsl_mqs_pm_ops = {
- SET_RUNTIME_PM_OPS(fsl_mqs_runtime_suspend,
- fsl_mqs_runtime_resume,
- NULL)
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
+ RUNTIME_PM_OPS(fsl_mqs_runtime_suspend, fsl_mqs_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
};
static const struct fsl_mqs_soc_data fsl_mqs_imx8qm_data = {
@@ -390,7 +385,7 @@ static struct platform_driver fsl_mqs_driver = {
.driver = {
.name = "fsl-mqs",
.of_match_table = fsl_mqs_dt_ids,
- .pm = &fsl_mqs_pm_ops,
+ .pm = pm_ptr(&fsl_mqs_pm_ops),
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/7] ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS()
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
2024-08-08 18:49 ` [PATCH 2/7] ASoC: fsl_mqs: " Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-08 18:49 ` [PATCH 4/7] ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_RUNTIME_PM_OPS() with its modern RUNTIME_PM_OPS()
alternative.
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 CONFIG_PM ifdefery from the runtime
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/fsl_rpmsg.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/sound/soc/fsl/fsl_rpmsg.c b/sound/soc/fsl/fsl_rpmsg.c
index 467d6bc9f956..be46fbfd487a 100644
--- a/sound/soc/fsl/fsl_rpmsg.c
+++ b/sound/soc/fsl/fsl_rpmsg.c
@@ -286,7 +286,6 @@ static void fsl_rpmsg_remove(struct platform_device *pdev)
platform_device_unregister(rpmsg->card_pdev);
}
-#ifdef CONFIG_PM
static int fsl_rpmsg_runtime_resume(struct device *dev)
{
struct fsl_rpmsg *rpmsg = dev_get_drvdata(dev);
@@ -321,12 +320,10 @@ static int fsl_rpmsg_runtime_suspend(struct device *dev)
return 0;
}
-#endif
static const struct dev_pm_ops fsl_rpmsg_pm_ops = {
- SET_RUNTIME_PM_OPS(fsl_rpmsg_runtime_suspend,
- fsl_rpmsg_runtime_resume,
- NULL)
+ RUNTIME_PM_OPS(fsl_rpmsg_runtime_suspend, fsl_rpmsg_runtime_resume,
+ NULL)
};
static struct platform_driver fsl_rpmsg_driver = {
@@ -334,7 +331,7 @@ static struct platform_driver fsl_rpmsg_driver = {
.remove_new = fsl_rpmsg_remove,
.driver = {
.name = "fsl_rpmsg",
- .pm = &fsl_rpmsg_pm_ops,
+ .pm = pm_ptr(&fsl_rpmsg_pm_ops),
.of_match_table = fsl_rpmsg_ids,
},
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/7] ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
2024-08-08 18:49 ` [PATCH 2/7] ASoC: fsl_mqs: " Fabio Estevam
2024-08-08 18:49 ` [PATCH 3/7] ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS() Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-08 18:49 ` [PATCH 5/7] ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS Fabio Estevam
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.
The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_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 CONFIG_PM ifdefery from the runtime
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/fsl_spdif.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index a63121c888e0..eace399cb064 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1667,7 +1667,6 @@ static void fsl_spdif_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
}
-#ifdef CONFIG_PM
static int fsl_spdif_runtime_suspend(struct device *dev)
{
struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev);
@@ -1739,13 +1738,11 @@ static int fsl_spdif_runtime_resume(struct device *dev)
return ret;
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops fsl_spdif_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
- SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume,
- NULL)
+ SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
+ RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume,
+ NULL)
};
static const struct of_device_id fsl_spdif_dt_ids[] = {
@@ -1763,7 +1760,7 @@ static struct platform_driver fsl_spdif_driver = {
.driver = {
.name = "fsl-spdif-dai",
.of_match_table = fsl_spdif_dt_ids,
- .pm = &fsl_spdif_pm,
+ .pm = pm_ptr(&fsl_spdif_pm),
},
.probe = fsl_spdif_probe,
.remove_new = fsl_spdif_remove,
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 5/7] ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
` (2 preceding siblings ...)
2024-08-08 18:49 ` [PATCH 4/7] ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-08 18:49 ` [PATCH 6/7] ASoC: imx-audmux: " Fabio Estevam
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS()
alternative.
The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
the compiler to evaluate if the suspend/resume() functions are used at
build time or are simply dead code.
This allows removing the CONFIG_PM_SLEEP ifdefery from the
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/fsl_ssi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 4ca3a16f7ac0..c4c1d9c44056 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -1693,7 +1693,6 @@ static void fsl_ssi_remove(struct platform_device *pdev)
}
}
-#ifdef CONFIG_PM_SLEEP
static int fsl_ssi_suspend(struct device *dev)
{
struct fsl_ssi *ssi = dev_get_drvdata(dev);
@@ -1723,17 +1722,16 @@ static int fsl_ssi_resume(struct device *dev)
return regcache_sync(regs);
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops fsl_ssi_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume)
+ SYSTEM_SLEEP_PM_OPS(fsl_ssi_suspend, fsl_ssi_resume)
};
static struct platform_driver fsl_ssi_driver = {
.driver = {
.name = "fsl-ssi-dai",
.of_match_table = fsl_ssi_ids,
- .pm = &fsl_ssi_pm,
+ .pm = pm_sleep_ptr(&fsl_ssi_pm),
},
.probe = fsl_ssi_probe,
.remove_new = fsl_ssi_remove,
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 6/7] ASoC: imx-audmux: Switch to SYSTEM_SLEEP_PM_OPS
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
` (3 preceding siblings ...)
2024-08-08 18:49 ` [PATCH 5/7] ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-08 18:49 ` [PATCH 7/7] ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
2024-08-14 21:19 ` [PATCH 1/7] ASoC: fsl_audmix: " Mark Brown
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_SYSTEM_SLEEP_PM_OPS() with its modern SYSTEM_SLEEP_PM_OPS()
alternative.
The combined usage of pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS() allows
the compiler to evaluate if the suspend/resume() functions
are used at build time or are simply dead code.
This allows removing the CONFIG_PM_SLEEP ifdefery from the
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/imx-audmux.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c
index 747ab2f1aae3..f97ae14dc452 100644
--- a/sound/soc/fsl/imx-audmux.c
+++ b/sound/soc/fsl/imx-audmux.c
@@ -320,7 +320,6 @@ static void imx_audmux_remove(struct platform_device *pdev)
audmux_debugfs_remove();
}
-#ifdef CONFIG_PM_SLEEP
static int imx_audmux_suspend(struct device *dev)
{
int i;
@@ -348,10 +347,9 @@ static int imx_audmux_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops imx_audmux_pm = {
- SET_SYSTEM_SLEEP_PM_OPS(imx_audmux_suspend, imx_audmux_resume)
+ SYSTEM_SLEEP_PM_OPS(imx_audmux_suspend, imx_audmux_resume)
};
static struct platform_driver imx_audmux_driver = {
@@ -359,7 +357,7 @@ static struct platform_driver imx_audmux_driver = {
.remove_new = imx_audmux_remove,
.driver = {
.name = DRIVER_NAME,
- .pm = &imx_audmux_pm,
+ .pm = pm_sleep_ptr(&imx_audmux_pm),
.of_match_table = imx_audmux_dt_ids,
}
};
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 7/7] ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
` (4 preceding siblings ...)
2024-08-08 18:49 ` [PATCH 6/7] ASoC: imx-audmux: " Fabio Estevam
@ 2024-08-08 18:49 ` Fabio Estevam
2024-08-14 21:19 ` [PATCH 1/7] ASoC: fsl_audmix: " Mark Brown
6 siblings, 0 replies; 8+ messages in thread
From: Fabio Estevam @ 2024-08-08 18:49 UTC (permalink / raw)
To: broonie; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
From: Fabio Estevam <festevam@denx.de>
Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.
The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_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 CONFIG_PM ifdefery from the runtime
suspend/resume() functions.
Signed-off-by: Fabio Estevam <festevam@denx.de>
---
sound/soc/fsl/imx-pcm-rpmsg.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/sound/soc/fsl/imx-pcm-rpmsg.c b/sound/soc/fsl/imx-pcm-rpmsg.c
index b0944a07ab47..22156f99dcee 100644
--- a/sound/soc/fsl/imx-pcm-rpmsg.c
+++ b/sound/soc/fsl/imx-pcm-rpmsg.c
@@ -753,7 +753,6 @@ static void imx_rpmsg_pcm_remove(struct platform_device *pdev)
destroy_workqueue(info->rpmsg_wq);
}
-#ifdef CONFIG_PM
static int imx_rpmsg_pcm_runtime_resume(struct device *dev)
{
struct rpmsg_info *info = dev_get_drvdata(dev);
@@ -771,9 +770,7 @@ static int imx_rpmsg_pcm_runtime_suspend(struct device *dev)
return 0;
}
-#endif
-#ifdef CONFIG_PM_SLEEP
static int imx_rpmsg_pcm_suspend(struct device *dev)
{
struct rpmsg_info *info = dev_get_drvdata(dev);
@@ -809,14 +806,11 @@ static int imx_rpmsg_pcm_resume(struct device *dev)
return 0;
}
-#endif /* CONFIG_PM_SLEEP */
static const struct dev_pm_ops imx_rpmsg_pcm_pm_ops = {
- SET_RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend,
- imx_rpmsg_pcm_runtime_resume,
- NULL)
- SET_SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend,
- imx_rpmsg_pcm_resume)
+ RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend,
+ imx_rpmsg_pcm_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend, imx_rpmsg_pcm_resume)
};
static const struct platform_device_id imx_rpmsg_pcm_id_table[] = {
@@ -832,7 +826,7 @@ static struct platform_driver imx_pcm_rpmsg_driver = {
.id_table = imx_rpmsg_pcm_id_table,
.driver = {
.name = IMX_PCM_DRV_NAME,
- .pm = &imx_rpmsg_pcm_pm_ops,
+ .pm = pm_ptr(&imx_rpmsg_pcm_pm_ops),
},
};
module_platform_driver(imx_pcm_rpmsg_driver);
--
2.34.1
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
2024-08-08 18:49 [PATCH 1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
` (5 preceding siblings ...)
2024-08-08 18:49 ` [PATCH 7/7] ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS() Fabio Estevam
@ 2024-08-14 21:19 ` Mark Brown
6 siblings, 0 replies; 8+ messages in thread
From: Mark Brown @ 2024-08-14 21:19 UTC (permalink / raw)
To: Fabio Estevam; +Cc: shengjiu.wang, alsa-devel, Fabio Estevam
On Thu, 08 Aug 2024 15:49:38 -0300, Fabio Estevam wrote:
> Replace SET_RUNTIME_PM_OPS()/SET SYSTEM_SLEEP_PM_OPS() with their modern
> RUNTIME_PM_OPS() and SYSTEM_SLEEP_PM_OPS() alternatives.
>
> The combined usage of pm_ptr() and RUNTIME_PM_OPS/SYSTEM_SLEEP_PM_OPS()
> allows the compiler to evaluate if the runtime suspend/resume() functions
> are used at build time or are simply dead code.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/7] ASoC: fsl_audmix: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
commit: 73abd9698960c5d097559432cac13bb1f0aaf3df
[2/7] ASoC: fsl_mqs: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
commit: b7e4dd8da05a9de18471868a914d609522d04fdd
[3/7] ASoC: fsl_rpmsg: Switch to RUNTIME_PM_OPS()
commit: bbc0798c402acb6799a8332fb0a49c05f4a5a414
[4/7] ASoC: fsl_spdif: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
commit: 01661bb9560def44eff0c79ebf14ec7ce0fdffab
[5/7] ASoC: fsl_ssi: Switch to SYSTEM_SLEEP_PM_OPS
commit: 8ffb2fe2e92c98e5c69e9af9656baed7d298059a
[6/7] ASoC: imx-audmux: Switch to SYSTEM_SLEEP_PM_OPS
commit: c504885a351b57c26c077992dde6904b8bbbdcd4
[7/7] ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()
commit: bcbbf713061c41f696f47baa4bdcb789a59d4f21
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 8+ messages in thread