]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: SOF: pci: Convert to EXPORT_NS_DEV_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Mon, 17 Mar 2025 09:55:40 +0000 (10:55 +0100)
committerMark Brown <broonie@kernel.org>
Mon, 17 Mar 2025 10:14:56 +0000 (10:14 +0000)
Use the newer EXPORT_NS_DEV_PM_OPS() macro together with pm_ptr().

This optimizes slightly when CONFIG_PM is disabled, too.

Cc: sound-open-firmware@alsa-project.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250317095603.20073-79-tiwai@suse.de
Signed-off-by: Mark Brown <broonie@kernel.org>
14 files changed:
sound/soc/sof/amd/pci-acp63.c
sound/soc/sof/amd/pci-acp70.c
sound/soc/sof/amd/pci-rn.c
sound/soc/sof/amd/pci-vangogh.c
sound/soc/sof/intel/pci-apl.c
sound/soc/sof/intel/pci-cnl.c
sound/soc/sof/intel/pci-icl.c
sound/soc/sof/intel/pci-lnl.c
sound/soc/sof/intel/pci-mtl.c
sound/soc/sof/intel/pci-ptl.c
sound/soc/sof/intel/pci-skl.c
sound/soc/sof/intel/pci-tgl.c
sound/soc/sof/intel/pci-tng.c
sound/soc/sof/sof-pci-dev.c

index 13aa87cdeeac39e25c82b477a4ad7b83138dcc13..21ffdfdcf03de3e3a2985f7dd7e54e510b12e24b 100644 (file)
@@ -104,7 +104,7 @@ static struct pci_driver snd_sof_pci_amd_acp63_driver = {
        .probe = acp63_pci_probe,
        .remove = acp63_pci_remove,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_amd_acp63_driver);
index d886bdf3a11287ff169fa87807e6a769692a340f..8fa1170a2161e9ee6b9e2345ab69e10453c6ed1e 100644 (file)
@@ -100,7 +100,7 @@ static struct pci_driver snd_sof_pci_amd_acp70_driver = {
        .probe = acp70_pci_probe,
        .remove = acp70_pci_remove,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_amd_acp70_driver);
index 4a36029a00decebfa225cd2647123972b0384603..2b7fbcf11b55721db17d1c817862edc13892c10b 100644 (file)
@@ -97,7 +97,7 @@ static struct pci_driver snd_sof_pci_amd_rn_driver = {
        .probe = acp_pci_rn_probe,
        .remove = acp_pci_rn_remove,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_amd_rn_driver);
index caf9e2b2e46380a34e9ee65c48a9a8c6df9efd97..6ef692becfb91ec65b23344a193f78f0da445636 100644 (file)
@@ -90,7 +90,7 @@ static struct pci_driver snd_sof_pci_amd_vgh_driver = {
        .probe = acp_pci_vgh_probe,
        .remove = acp_pci_vgh_remove,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_amd_vgh_driver);
index 94ab3c61e3f7fedfd4fd5036237449475941dad3..0bf7ee753bc3be5c6b607d3baae816b42c9aa80b 100644 (file)
@@ -99,7 +99,7 @@ static struct pci_driver snd_sof_pci_intel_apl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_apl_driver);
index 739c352c3860fedd9472ce3be1d0a09a616cf2ac..de48640024e49301aecfbf1b0112566131fb9da1 100644 (file)
@@ -137,7 +137,7 @@ static struct pci_driver snd_sof_pci_intel_cnl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_cnl_driver);
index 8545ab95eac8b12111238f4dc5d185baa6393bba..fd219e6548445c46d4d018050e6c5da14069cea0 100644 (file)
@@ -102,7 +102,7 @@ static struct pci_driver snd_sof_pci_intel_icl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_icl_driver);
index 91b9cff8c4cae401f2a5ec556f07df6855161179..ae379c23f008f7c5f0b42480e7f4d8a6e2182a7a 100644 (file)
@@ -72,7 +72,7 @@ static struct pci_driver snd_sof_pci_intel_lnl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_lnl_driver);
index c5048a4a56be14af88152efa227202476ccf4ea5..7b25339991952ad24ac36b526f380e816393ac30 100644 (file)
@@ -135,7 +135,7 @@ static struct pci_driver snd_sof_pci_intel_mtl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_mtl_driver);
index 3812ab6d99c067fa8553e56a0e169db11cab4d6f..7d4c46f569317ca9416d6b5af990da75e7a4c591 100644 (file)
@@ -71,7 +71,7 @@ static struct pci_driver snd_sof_pci_intel_ptl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_ptl_driver);
index bd9daae51e4cc3e1105672a410a19166dd2107af..a16945dc35f7dc6e04451cd82475f518018a699c 100644 (file)
@@ -83,7 +83,7 @@ static struct pci_driver snd_sof_pci_intel_skl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_skl_driver);
index f76a7197f6caa46613c2df8706b0e0384512e552..437c438198255569df4eaee210cd330528eb6870 100644 (file)
@@ -311,7 +311,7 @@ static struct pci_driver snd_sof_pci_intel_tgl_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_tgl_driver);
index 3eb7400942dd7ce55256afbdde2a8a3f8096144f..0c11cc1fd820eb5bbde9ee19ccde55bdb40507fb 100644 (file)
@@ -238,7 +238,7 @@ static struct pci_driver snd_sof_pci_intel_tng_driver = {
        .remove = sof_pci_remove,
        .shutdown = sof_pci_shutdown,
        .driver = {
-               .pm = &sof_pci_pm,
+               .pm = pm_ptr(&sof_pci_pm),
        },
 };
 module_pci_driver(snd_sof_pci_intel_tng_driver);
index 103377e2caaf82bb15661b935fa0fefc52c325fa..2fc14b9a33d465a122b221a586c96ac17d41768d 100644 (file)
@@ -155,14 +155,13 @@ static const struct dmi_system_id community_key_platforms[] = {
        {},
 };
 
-const struct dev_pm_ops sof_pci_pm = {
+EXPORT_NS_DEV_PM_OPS(sof_pci_pm, SND_SOC_SOF_PCI_DEV) = {
        .prepare = snd_sof_prepare,
        .complete = snd_sof_complete,
-       SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
-       SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
-                          snd_sof_runtime_idle)
+       SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
+       RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
+                      snd_sof_runtime_idle)
 };
-EXPORT_SYMBOL_NS(sof_pci_pm, "SND_SOC_SOF_PCI_DEV");
 
 static void sof_pci_probe_complete(struct device *dev)
 {