aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opl3sa2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opl3sa2.c')
-rw-r--r--sound/isa/opl3sa2.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index ca359e0c674b..9d8431978501 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -91,8 +91,10 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444);
91MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); 91MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi.");
92 92
93static struct platform_device *platform_devices[SNDRV_CARDS]; 93static struct platform_device *platform_devices[SNDRV_CARDS];
94#ifdef CONFIG_PNP
94static int pnp_registered; 95static int pnp_registered;
95static int pnpc_registered; 96static int pnpc_registered;
97#endif
96 98
97/* control ports */ 99/* control ports */
98#define OPL3SA2_PM_CTRL 0x01 100#define OPL3SA2_PM_CTRL 0x01
@@ -721,7 +723,7 @@ static int __devinit snd_opl3sa2_probe(struct snd_card *card, int dev)
721 } 723 }
722 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d", 724 sprintf(card->longname, "%s at 0x%lx, irq %d, dma %d",
723 card->shortname, chip->port, xirq, xdma1); 725 card->shortname, chip->port, xirq, xdma1);
724 if (dma2 >= 0) 726 if (xdma2 >= 0)
725 sprintf(card->longname + strlen(card->longname), "&%d", xdma2); 727 sprintf(card->longname + strlen(card->longname), "&%d", xdma2);
726 728
727 return snd_card_register(card); 729 return snd_card_register(card);
@@ -779,7 +781,7 @@ static int snd_opl3sa2_pnp_resume(struct pnp_dev *pdev)
779#endif 781#endif
780 782
781static struct pnp_driver opl3sa2_pnp_driver = { 783static struct pnp_driver opl3sa2_pnp_driver = {
782 .name = "opl3sa2-pnpbios", 784 .name = "snd-opl3sa2-pnpbios",
783 .id_table = snd_opl3sa2_pnpbiosids, 785 .id_table = snd_opl3sa2_pnpbiosids,
784 .probe = snd_opl3sa2_pnp_detect, 786 .probe = snd_opl3sa2_pnp_detect,
785 .remove = __devexit_p(snd_opl3sa2_pnp_remove), 787 .remove = __devexit_p(snd_opl3sa2_pnp_remove),
@@ -846,7 +848,7 @@ static int snd_opl3sa2_pnp_cresume(struct pnp_card_link *pcard)
846 848
847static struct pnp_card_driver opl3sa2_pnpc_driver = { 849static struct pnp_card_driver opl3sa2_pnpc_driver = {
848 .flags = PNP_DRIVER_RES_DISABLE, 850 .flags = PNP_DRIVER_RES_DISABLE,
849 .name = "opl3sa2", 851 .name = "snd-opl3sa2-cpnp",
850 .id_table = snd_opl3sa2_pnpids, 852 .id_table = snd_opl3sa2_pnpids,
851 .probe = snd_opl3sa2_pnp_cdetect, 853 .probe = snd_opl3sa2_pnp_cdetect,
852 .remove = __devexit_p(snd_opl3sa2_pnp_cremove), 854 .remove = __devexit_p(snd_opl3sa2_pnp_cremove),
@@ -929,10 +931,12 @@ static void __init_or_module snd_opl3sa2_unregister_all(void)
929{ 931{
930 int i; 932 int i;
931 933
934#ifdef CONFIG_PNP
932 if (pnpc_registered) 935 if (pnpc_registered)
933 pnp_unregister_card_driver(&opl3sa2_pnpc_driver); 936 pnp_unregister_card_driver(&opl3sa2_pnpc_driver);
934 if (pnp_registered) 937 if (pnp_registered)
935 pnp_unregister_driver(&opl3sa2_pnp_driver); 938 pnp_unregister_driver(&opl3sa2_pnp_driver);
939#endif
936 for (i = 0; i < ARRAY_SIZE(platform_devices); ++i) 940 for (i = 0; i < ARRAY_SIZE(platform_devices); ++i)
937 platform_device_unregister(platform_devices[i]); 941 platform_device_unregister(platform_devices[i]);
938 platform_driver_unregister(&snd_opl3sa2_nonpnp_driver); 942 platform_driver_unregister(&snd_opl3sa2_nonpnp_driver);
@@ -961,6 +965,7 @@ static int __init alsa_card_opl3sa2_init(void)
961 cards++; 965 cards++;
962 } 966 }
963 967
968#ifdef CONFIG_PNP
964 err = pnp_register_driver(&opl3sa2_pnp_driver); 969 err = pnp_register_driver(&opl3sa2_pnp_driver);
965 if (err >= 0) { 970 if (err >= 0) {
966 pnp_registered = 1; 971 pnp_registered = 1;
@@ -971,6 +976,7 @@ static int __init alsa_card_opl3sa2_init(void)
971 pnpc_registered = 1; 976 pnpc_registered = 1;
972 cards += err; 977 cards += err;
973 } 978 }
979#endif
974 980
975 if (!cards) { 981 if (!cards) {
976#ifdef MODULE 982#ifdef MODULE