]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ALSA: oxygen: Convert to EXPORT_SIMPLE_DEV_PM_OPS()
authorTakashi Iwai <tiwai@suse.de>
Thu, 13 Mar 2025 17:07:25 +0000 (18:07 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 14 Mar 2025 10:07:13 +0000 (11:07 +0100)
Use the newer EXPORT_SIMPLE_DEV_PM_OPS() macro instead of
SIPLE_DEV_PM_OPS() and manual export, together with pm_ptr() macro,
which makes CONFIG_PM_SLEEP ifdefs superfluous.

Merely a cleanup, there should be no actual code change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250313170731.26943-8-tiwai@suse.de
sound/pci/oxygen/oxygen.c
sound/pci/oxygen/oxygen.h
sound/pci/oxygen/oxygen_lib.c
sound/pci/oxygen/se6x.c
sound/pci/oxygen/virtuoso.c

index c346f42befc277afa51dcea0fbc0876b9885f667..6d0deea47ee6fc80507ba37a7825b620e165a21e 100644 (file)
@@ -854,11 +854,9 @@ static struct pci_driver oxygen_driver = {
        .name = KBUILD_MODNAME,
        .id_table = oxygen_ids,
        .probe = generic_oxygen_probe,
-#ifdef CONFIG_PM_SLEEP
        .driver = {
-               .pm = &oxygen_pci_pm,
+               .pm = pm_ptr(&oxygen_pci_pm),
        },
-#endif
 };
 
 module_pci_driver(oxygen_driver);
index 0cae640708f35e48aa0b865275c5d9e572ec830e..820026daf838c63cfcf5c32cfe21a6aaf2fbf0ce 100644 (file)
@@ -161,9 +161,7 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
                                      const struct pci_device_id *id
                                     )
                    );
-#ifdef CONFIG_PM_SLEEP
 extern const struct dev_pm_ops oxygen_pci_pm;
-#endif
 void oxygen_pci_shutdown(struct pci_dev *pci);
 
 /* oxygen_mixer.c */
index 92ffe9dc20c55699a0c95cc9b4b1ac2ba8c3f98d..9340d3c9ffd6567f9a14cbe5c1a5fdfad21945ed 100644 (file)
@@ -713,7 +713,6 @@ int oxygen_pci_probe(struct pci_dev *pci, int index, char *id,
 }
 EXPORT_SYMBOL(oxygen_pci_probe);
 
-#ifdef CONFIG_PM_SLEEP
 static int oxygen_pci_suspend(struct device *dev)
 {
        struct snd_card *card = dev_get_drvdata(dev);
@@ -789,9 +788,7 @@ static int oxygen_pci_resume(struct device *dev)
        return 0;
 }
 
-SIMPLE_DEV_PM_OPS(oxygen_pci_pm, oxygen_pci_suspend, oxygen_pci_resume);
-EXPORT_SYMBOL(oxygen_pci_pm);
-#endif /* CONFIG_PM_SLEEP */
+EXPORT_SIMPLE_DEV_PM_OPS(oxygen_pci_pm, oxygen_pci_suspend, oxygen_pci_resume);
 
 void oxygen_pci_shutdown(struct pci_dev *pci)
 {
index 17650a5b1bfa19abafd5e8cebfe425b56b6b852f..c1bb9dd1cd540ea9ee7454613a7e1ea7ab1ab2ae 100644 (file)
@@ -137,11 +137,9 @@ static struct pci_driver se6x_driver = {
        .name = KBUILD_MODNAME,
        .id_table = se6x_ids,
        .probe = se6x_probe,
-#ifdef CONFIG_PM_SLEEP
        .driver = {
-               .pm = &oxygen_pci_pm,
+               .pm = pm_ptr(&oxygen_pci_pm),
        },
-#endif
        .shutdown = oxygen_pci_shutdown,
 };
 
index 2e405133371f46440c7417a0cf46151d7ade7518..0bfe6d8dde3e101cf001f71d2ed5be7dd90051db 100644 (file)
@@ -82,11 +82,9 @@ static struct pci_driver xonar_driver = {
        .name = KBUILD_MODNAME,
        .id_table = xonar_ids,
        .probe = xonar_probe,
-#ifdef CONFIG_PM_SLEEP
        .driver = {
-               .pm = &oxygen_pci_pm,
+               .pm = pm_ptr(&oxygen_pci_pm),
        },
-#endif
        .shutdown = oxygen_pci_shutdown,
 };