Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: imx-pcm-rpmsg: Switch to RUNTIME/SYSTEM_SLEEP_PM_OPS()

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>
Link: https://patch.msgid.link/20240808184944.267686-7-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Fabio Estevam and committed by
Mark Brown
bcbbf713 c504885a

+4 -10
+4 -10
sound/soc/fsl/imx-pcm-rpmsg.c
··· 753 753 destroy_workqueue(info->rpmsg_wq); 754 754 } 755 755 756 - #ifdef CONFIG_PM 757 756 static int imx_rpmsg_pcm_runtime_resume(struct device *dev) 758 757 { 759 758 struct rpmsg_info *info = dev_get_drvdata(dev); ··· 770 771 771 772 return 0; 772 773 } 773 - #endif 774 774 775 - #ifdef CONFIG_PM_SLEEP 776 775 static int imx_rpmsg_pcm_suspend(struct device *dev) 777 776 { 778 777 struct rpmsg_info *info = dev_get_drvdata(dev); ··· 806 809 807 810 return 0; 808 811 } 809 - #endif /* CONFIG_PM_SLEEP */ 810 812 811 813 static const struct dev_pm_ops imx_rpmsg_pcm_pm_ops = { 812 - SET_RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend, 813 - imx_rpmsg_pcm_runtime_resume, 814 - NULL) 815 - SET_SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend, 816 - imx_rpmsg_pcm_resume) 814 + RUNTIME_PM_OPS(imx_rpmsg_pcm_runtime_suspend, 815 + imx_rpmsg_pcm_runtime_resume, NULL) 816 + SYSTEM_SLEEP_PM_OPS(imx_rpmsg_pcm_suspend, imx_rpmsg_pcm_resume) 817 817 }; 818 818 819 819 static const struct platform_device_id imx_rpmsg_pcm_id_table[] = { ··· 826 832 .id_table = imx_rpmsg_pcm_id_table, 827 833 .driver = { 828 834 .name = IMX_PCM_DRV_NAME, 829 - .pm = &imx_rpmsg_pcm_pm_ops, 835 + .pm = pm_ptr(&imx_rpmsg_pcm_pm_ops), 830 836 }, 831 837 }; 832 838 module_platform_driver(imx_pcm_rpmsg_driver);