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: fsl_spdif: 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-4-festevam@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Fabio Estevam and committed by
Mark Brown
01661bb9 bbc0798c

+4 -7
+4 -7
sound/soc/fsl/fsl_spdif.c
··· 1667 1667 pm_runtime_disable(&pdev->dev); 1668 1668 } 1669 1669 1670 - #ifdef CONFIG_PM 1671 1670 static int fsl_spdif_runtime_suspend(struct device *dev) 1672 1671 { 1673 1672 struct fsl_spdif_priv *spdif_priv = dev_get_drvdata(dev); ··· 1738 1739 1739 1740 return ret; 1740 1741 } 1741 - #endif /* CONFIG_PM */ 1742 1742 1743 1743 static const struct dev_pm_ops fsl_spdif_pm = { 1744 - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, 1745 - pm_runtime_force_resume) 1746 - SET_RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, 1747 - NULL) 1744 + SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 1745 + RUNTIME_PM_OPS(fsl_spdif_runtime_suspend, fsl_spdif_runtime_resume, 1746 + NULL) 1748 1747 }; 1749 1748 1750 1749 static const struct of_device_id fsl_spdif_dt_ids[] = { ··· 1760 1763 .driver = { 1761 1764 .name = "fsl-spdif-dai", 1762 1765 .of_match_table = fsl_spdif_dt_ids, 1763 - .pm = &fsl_spdif_pm, 1766 + .pm = pm_ptr(&fsl_spdif_pm), 1764 1767 }, 1765 1768 .probe = fsl_spdif_probe, 1766 1769 .remove_new = fsl_spdif_remove,