diff options
author | Rene Herman <rene.herman@gmail.com> | 2007-05-15 05:42:56 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-16 06:22:44 -0400 |
commit | 609d7694152f85734560ddc83be5e551b34d8c44 (patch) | |
tree | 14334de027169b2549933ff56cb1fd78e3bd41d6 | |
parent | 60af15f529d22a93805e74dd3c52b6f8134511d2 (diff) |
[ALSA] Fix probe of non-PnP ISA devices
isa_register_driver() returns an error if no device is found
and it's no fatal error for the drivers with pnp support.
Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/isa/cmi8330.c | 15 | ||||
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 20 | ||||
-rw-r--r-- | sound/isa/es18xx.c | 19 | ||||
-rw-r--r-- | sound/isa/gus/interwave.c | 15 | ||||
-rw-r--r-- | sound/isa/opl3sa2.c | 15 | ||||
-rw-r--r-- | sound/isa/sb/sb16.c | 15 | ||||
-rw-r--r-- | sound/isa/sscape.c | 28 | ||||
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 14 |
8 files changed, 94 insertions, 47 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 214d65d94c45..f471f8ad6885 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -109,6 +109,7 @@ module_param_array(wssdma, int, NULL, 0444); | |||
109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); | 109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); |
110 | 110 | ||
111 | #ifdef CONFIG_PNP | 111 | #ifdef CONFIG_PNP |
112 | static int isa_registered; | ||
112 | static int pnp_registered; | 113 | static int pnp_registered; |
113 | #endif | 114 | #endif |
114 | 115 | ||
@@ -686,14 +687,18 @@ static int __init alsa_card_cmi8330_init(void) | |||
686 | int err; | 687 | int err; |
687 | 688 | ||
688 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); | 689 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); |
689 | if (err < 0) | ||
690 | return err; | ||
691 | #ifdef CONFIG_PNP | 690 | #ifdef CONFIG_PNP |
691 | if (!err) | ||
692 | isa_registered = 1; | ||
693 | |||
692 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); | 694 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); |
693 | if (!err) | 695 | if (!err) |
694 | pnp_registered = 1; | 696 | pnp_registered = 1; |
697 | |||
698 | if (isa_registered) | ||
699 | err = 0; | ||
695 | #endif | 700 | #endif |
696 | return 0; | 701 | return err; |
697 | } | 702 | } |
698 | 703 | ||
699 | static void __exit alsa_card_cmi8330_exit(void) | 704 | static void __exit alsa_card_cmi8330_exit(void) |
@@ -701,8 +706,10 @@ static void __exit alsa_card_cmi8330_exit(void) | |||
701 | #ifdef CONFIG_PNP | 706 | #ifdef CONFIG_PNP |
702 | if (pnp_registered) | 707 | if (pnp_registered) |
703 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); | 708 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); |
709 | |||
710 | if (isa_registered) | ||
704 | #endif | 711 | #endif |
705 | isa_unregister_driver(&snd_cmi8330_driver); | 712 | isa_unregister_driver(&snd_cmi8330_driver); |
706 | } | 713 | } |
707 | 714 | ||
708 | module_init(alsa_card_cmi8330_init) | 715 | module_init(alsa_card_cmi8330_init) |
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 87f1392a2fa7..1a14f33b6ab0 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c | |||
@@ -127,6 +127,7 @@ module_param_array(dma2, int, NULL, 0444); | |||
127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); | 127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); |
128 | 128 | ||
129 | #ifdef CONFIG_PNP | 129 | #ifdef CONFIG_PNP |
130 | static int isa_registered; | ||
130 | static int pnpc_registered; | 131 | static int pnpc_registered; |
131 | #ifdef CS4232 | 132 | #ifdef CS4232 |
132 | static int pnp_registered; | 133 | static int pnp_registered; |
@@ -770,9 +771,9 @@ static int __init alsa_card_cs423x_init(void) | |||
770 | int err; | 771 | int err; |
771 | 772 | ||
772 | err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); | 773 | err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); |
773 | if (err < 0) | ||
774 | return err; | ||
775 | #ifdef CONFIG_PNP | 774 | #ifdef CONFIG_PNP |
775 | if (!err) | ||
776 | isa_registered = 1; | ||
776 | #ifdef CS4232 | 777 | #ifdef CS4232 |
777 | err = pnp_register_driver(&cs4232_pnp_driver); | 778 | err = pnp_register_driver(&cs4232_pnp_driver); |
778 | if (!err) | 779 | if (!err) |
@@ -781,8 +782,14 @@ static int __init alsa_card_cs423x_init(void) | |||
781 | err = pnp_register_card_driver(&cs423x_pnpc_driver); | 782 | err = pnp_register_card_driver(&cs423x_pnpc_driver); |
782 | if (!err) | 783 | if (!err) |
783 | pnpc_registered = 1; | 784 | pnpc_registered = 1; |
784 | #endif /* CONFIG_PNP */ | 785 | #ifdef CS4232 |
785 | return 0; | 786 | if (pnp_registered) |
787 | err = 0; | ||
788 | #endif | ||
789 | if (isa_registered) | ||
790 | err = 0; | ||
791 | #endif | ||
792 | return err; | ||
786 | } | 793 | } |
787 | 794 | ||
788 | static void __exit alsa_card_cs423x_exit(void) | 795 | static void __exit alsa_card_cs423x_exit(void) |
@@ -794,8 +801,9 @@ static void __exit alsa_card_cs423x_exit(void) | |||
794 | if (pnp_registered) | 801 | if (pnp_registered) |
795 | pnp_unregister_driver(&cs4232_pnp_driver); | 802 | pnp_unregister_driver(&cs4232_pnp_driver); |
796 | #endif | 803 | #endif |
797 | #endif /* CONFIG_PNP */ | 804 | if (isa_registered) |
798 | isa_unregister_driver(&cs423x_isa_driver); | 805 | #endif |
806 | isa_unregister_driver(&cs423x_isa_driver); | ||
799 | } | 807 | } |
800 | 808 | ||
801 | module_init(alsa_card_cs423x_init) | 809 | module_init(alsa_card_cs423x_init) |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index d2a9c7df0ce5..f7732bf90be3 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -2036,7 +2036,9 @@ module_param_array(dma2, int, NULL, 0444); | |||
2036 | MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); | 2036 | MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); |
2037 | 2037 | ||
2038 | #ifdef CONFIG_PNP | 2038 | #ifdef CONFIG_PNP |
2039 | static int pnp_registered, pnpc_registered; | 2039 | static int isa_registered; |
2040 | static int pnp_registered; | ||
2041 | static int pnpc_registered; | ||
2040 | 2042 | ||
2041 | static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { | 2043 | static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { |
2042 | { .id = "ESS1869" }, | 2044 | { .id = "ESS1869" }, |
@@ -2466,18 +2468,22 @@ static int __init alsa_card_es18xx_init(void) | |||
2466 | int err; | 2468 | int err; |
2467 | 2469 | ||
2468 | err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); | 2470 | err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); |
2469 | if (err < 0) | ||
2470 | return err; | ||
2471 | |||
2472 | #ifdef CONFIG_PNP | 2471 | #ifdef CONFIG_PNP |
2472 | if (!err) | ||
2473 | isa_registered = 1; | ||
2474 | |||
2473 | err = pnp_register_driver(&es18xx_pnp_driver); | 2475 | err = pnp_register_driver(&es18xx_pnp_driver); |
2474 | if (!err) | 2476 | if (!err) |
2475 | pnp_registered = 1; | 2477 | pnp_registered = 1; |
2478 | |||
2476 | err = pnp_register_card_driver(&es18xx_pnpc_driver); | 2479 | err = pnp_register_card_driver(&es18xx_pnpc_driver); |
2477 | if (!err) | 2480 | if (!err) |
2478 | pnpc_registered = 1; | 2481 | pnpc_registered = 1; |
2482 | |||
2483 | if (isa_registered || pnp_registered) | ||
2484 | err = 0; | ||
2479 | #endif | 2485 | #endif |
2480 | return 0; | 2486 | return err; |
2481 | } | 2487 | } |
2482 | 2488 | ||
2483 | static void __exit alsa_card_es18xx_exit(void) | 2489 | static void __exit alsa_card_es18xx_exit(void) |
@@ -2487,8 +2493,9 @@ static void __exit alsa_card_es18xx_exit(void) | |||
2487 | pnp_unregister_card_driver(&es18xx_pnpc_driver); | 2493 | pnp_unregister_card_driver(&es18xx_pnpc_driver); |
2488 | if (pnp_registered) | 2494 | if (pnp_registered) |
2489 | pnp_unregister_driver(&es18xx_pnp_driver); | 2495 | pnp_unregister_driver(&es18xx_pnp_driver); |
2496 | if (isa_registered) | ||
2490 | #endif | 2497 | #endif |
2491 | isa_unregister_driver(&snd_es18xx_isa_driver); | 2498 | isa_unregister_driver(&snd_es18xx_isa_driver); |
2492 | } | 2499 | } |
2493 | 2500 | ||
2494 | module_init(alsa_card_es18xx_init) | 2501 | module_init(alsa_card_es18xx_init) |
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 3e4657255536..0220cdbe1a2a 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -135,6 +135,7 @@ struct snd_interwave { | |||
135 | 135 | ||
136 | 136 | ||
137 | #ifdef CONFIG_PNP | 137 | #ifdef CONFIG_PNP |
138 | static int isa_registered; | ||
138 | static int pnp_registered; | 139 | static int pnp_registered; |
139 | 140 | ||
140 | static struct pnp_card_device_id snd_interwave_pnpids[] = { | 141 | static struct pnp_card_device_id snd_interwave_pnpids[] = { |
@@ -934,15 +935,18 @@ static int __init alsa_card_interwave_init(void) | |||
934 | int err; | 935 | int err; |
935 | 936 | ||
936 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); | 937 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); |
937 | if (err < 0) | ||
938 | return err; | ||
939 | #ifdef CONFIG_PNP | 938 | #ifdef CONFIG_PNP |
940 | /* ISA PnP cards */ | 939 | if (!err) |
940 | isa_registered = 1; | ||
941 | |||
941 | err = pnp_register_card_driver(&interwave_pnpc_driver); | 942 | err = pnp_register_card_driver(&interwave_pnpc_driver); |
942 | if (!err) | 943 | if (!err) |
943 | pnp_registered = 1; | 944 | pnp_registered = 1; |
945 | |||
946 | if (isa_registered) | ||
947 | err = 0; | ||
944 | #endif | 948 | #endif |
945 | return 0; | 949 | return err; |
946 | } | 950 | } |
947 | 951 | ||
948 | static void __exit alsa_card_interwave_exit(void) | 952 | static void __exit alsa_card_interwave_exit(void) |
@@ -950,8 +954,9 @@ static void __exit alsa_card_interwave_exit(void) | |||
950 | #ifdef CONFIG_PNP | 954 | #ifdef CONFIG_PNP |
951 | if (pnp_registered) | 955 | if (pnp_registered) |
952 | pnp_unregister_card_driver(&interwave_pnpc_driver); | 956 | pnp_unregister_card_driver(&interwave_pnpc_driver); |
957 | if (isa_registered) | ||
953 | #endif | 958 | #endif |
954 | isa_unregister_driver(&snd_interwave_driver); | 959 | isa_unregister_driver(&snd_interwave_driver); |
955 | } | 960 | } |
956 | 961 | ||
957 | module_init(alsa_card_interwave_init) | 962 | module_init(alsa_card_interwave_init) |
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 48743eb85fb6..61a323cc0e49 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -92,6 +92,7 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444); | |||
92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); | 92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); |
93 | 93 | ||
94 | #ifdef CONFIG_PNP | 94 | #ifdef CONFIG_PNP |
95 | static int isa_registered; | ||
95 | static int pnp_registered; | 96 | static int pnp_registered; |
96 | static int pnpc_registered; | 97 | static int pnpc_registered; |
97 | #endif | 98 | #endif |
@@ -967,17 +968,22 @@ static int __init alsa_card_opl3sa2_init(void) | |||
967 | int err; | 968 | int err; |
968 | 969 | ||
969 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); | 970 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); |
970 | if (err < 0) | ||
971 | return err; | ||
972 | #ifdef CONFIG_PNP | 971 | #ifdef CONFIG_PNP |
972 | if (!err) | ||
973 | isa_registered = 1; | ||
974 | |||
973 | err = pnp_register_driver(&opl3sa2_pnp_driver); | 975 | err = pnp_register_driver(&opl3sa2_pnp_driver); |
974 | if (!err) | 976 | if (!err) |
975 | pnp_registered = 1; | 977 | pnp_registered = 1; |
978 | |||
976 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); | 979 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); |
977 | if (!err) | 980 | if (!err) |
978 | pnpc_registered = 1; | 981 | pnpc_registered = 1; |
982 | |||
983 | if (isa_registered || pnp_registered) | ||
984 | err = 0; | ||
979 | #endif | 985 | #endif |
980 | return 0; | 986 | return err; |
981 | } | 987 | } |
982 | 988 | ||
983 | static void __exit alsa_card_opl3sa2_exit(void) | 989 | static void __exit alsa_card_opl3sa2_exit(void) |
@@ -987,8 +993,9 @@ static void __exit alsa_card_opl3sa2_exit(void) | |||
987 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); | 993 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); |
988 | if (pnp_registered) | 994 | if (pnp_registered) |
989 | pnp_unregister_driver(&opl3sa2_pnp_driver); | 995 | pnp_unregister_driver(&opl3sa2_pnp_driver); |
996 | if (isa_registered) | ||
990 | #endif | 997 | #endif |
991 | isa_unregister_driver(&snd_opl3sa2_isa_driver); | 998 | isa_unregister_driver(&snd_opl3sa2_isa_driver); |
992 | } | 999 | } |
993 | 1000 | ||
994 | module_init(alsa_card_opl3sa2_init) | 1001 | module_init(alsa_card_opl3sa2_init) |
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 2a19b0a39eda..c4ba24bfd27c 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -129,6 +129,7 @@ MODULE_PARM_DESC(seq_ports, "Number of sequencer ports for WaveTable synth."); | |||
129 | #endif | 129 | #endif |
130 | 130 | ||
131 | #ifdef CONFIG_PNP | 131 | #ifdef CONFIG_PNP |
132 | static int isa_registered; | ||
132 | static int pnp_registered; | 133 | static int pnp_registered; |
133 | #endif | 134 | #endif |
134 | 135 | ||
@@ -702,15 +703,18 @@ static int __init alsa_card_sb16_init(void) | |||
702 | int err; | 703 | int err; |
703 | 704 | ||
704 | err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); | 705 | err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); |
705 | if (err < 0) | ||
706 | return err; | ||
707 | #ifdef CONFIG_PNP | 706 | #ifdef CONFIG_PNP |
708 | /* PnP cards at last */ | 707 | if (!err) |
708 | isa_registered = 1; | ||
709 | |||
709 | err = pnp_register_card_driver(&sb16_pnpc_driver); | 710 | err = pnp_register_card_driver(&sb16_pnpc_driver); |
710 | if (!err) | 711 | if (!err) |
711 | pnp_registered = 1; | 712 | pnp_registered = 1; |
713 | |||
714 | if (isa_registered) | ||
715 | err = 0; | ||
712 | #endif | 716 | #endif |
713 | return 0; | 717 | return err; |
714 | } | 718 | } |
715 | 719 | ||
716 | static void __exit alsa_card_sb16_exit(void) | 720 | static void __exit alsa_card_sb16_exit(void) |
@@ -718,8 +722,9 @@ static void __exit alsa_card_sb16_exit(void) | |||
718 | #ifdef CONFIG_PNP | 722 | #ifdef CONFIG_PNP |
719 | if (pnp_registered) | 723 | if (pnp_registered) |
720 | pnp_unregister_card_driver(&sb16_pnpc_driver); | 724 | pnp_unregister_card_driver(&sb16_pnpc_driver); |
725 | if (isa_registered) | ||
721 | #endif | 726 | #endif |
722 | isa_unregister_driver(&snd_sb16_isa_driver); | 727 | isa_unregister_driver(&snd_sb16_isa_driver); |
723 | } | 728 | } |
724 | 729 | ||
725 | module_init(alsa_card_sb16_init) | 730 | module_init(alsa_card_sb16_init) |
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 08c14978558c..9ea417bcf3e5 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c | |||
@@ -69,7 +69,9 @@ module_param_array(dma, int, NULL, 0444); | |||
69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); | 69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); |
70 | 70 | ||
71 | #ifdef CONFIG_PNP | 71 | #ifdef CONFIG_PNP |
72 | static int isa_registered; | ||
72 | static int pnp_registered; | 73 | static int pnp_registered; |
74 | |||
73 | static struct pnp_card_device_id sscape_pnpids[] = { | 75 | static struct pnp_card_device_id sscape_pnpids[] = { |
74 | { .id = "ENS3081", .devs = { { "ENS0000" } } }, | 76 | { .id = "ENS3081", .devs = { { "ENS0000" } } }, |
75 | { .id = "" } /* end */ | 77 | { .id = "" } /* end */ |
@@ -1405,22 +1407,21 @@ static struct pnp_card_driver sscape_pnpc_driver = { | |||
1405 | 1407 | ||
1406 | static int __init sscape_init(void) | 1408 | static int __init sscape_init(void) |
1407 | { | 1409 | { |
1408 | int ret; | 1410 | int err; |
1409 | 1411 | ||
1410 | /* | 1412 | err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); |
1411 | * First check whether we were passed any parameters. | ||
1412 | * These MUST take precedence over ANY automatic way | ||
1413 | * of allocating cards, because the operator is | ||
1414 | * S-P-E-L-L-I-N-G it out for us... | ||
1415 | */ | ||
1416 | ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS); | ||
1417 | if (ret < 0) | ||
1418 | return ret; | ||
1419 | #ifdef CONFIG_PNP | 1413 | #ifdef CONFIG_PNP |
1420 | if (pnp_register_card_driver(&sscape_pnpc_driver) == 0) | 1414 | if (!err) |
1415 | isa_registered = 1; | ||
1416 | |||
1417 | err = pnp_register_card_driver(&sscape_pnpc_driver); | ||
1418 | if (!err) | ||
1421 | pnp_registered = 1; | 1419 | pnp_registered = 1; |
1420 | |||
1421 | if (isa_registered) | ||
1422 | err = 0; | ||
1422 | #endif | 1423 | #endif |
1423 | return 0; | 1424 | return err; |
1424 | } | 1425 | } |
1425 | 1426 | ||
1426 | static void __exit sscape_exit(void) | 1427 | static void __exit sscape_exit(void) |
@@ -1428,8 +1429,9 @@ static void __exit sscape_exit(void) | |||
1428 | #ifdef CONFIG_PNP | 1429 | #ifdef CONFIG_PNP |
1429 | if (pnp_registered) | 1430 | if (pnp_registered) |
1430 | pnp_unregister_card_driver(&sscape_pnpc_driver); | 1431 | pnp_unregister_card_driver(&sscape_pnpc_driver); |
1432 | if (isa_registered) | ||
1431 | #endif | 1433 | #endif |
1432 | isa_unregister_driver(&snd_sscape_driver); | 1434 | isa_unregister_driver(&snd_sscape_driver); |
1433 | } | 1435 | } |
1434 | 1436 | ||
1435 | module_init(sscape_init); | 1437 | module_init(sscape_init); |
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 75673f723857..83c2fc4cfc64 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -86,6 +86,7 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444); | |||
86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); | 86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); |
87 | 87 | ||
88 | #ifdef CONFIG_PNP | 88 | #ifdef CONFIG_PNP |
89 | static int isa_registered; | ||
89 | static int pnp_registered; | 90 | static int pnp_registered; |
90 | 91 | ||
91 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { | 92 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { |
@@ -706,14 +707,18 @@ static int __init alsa_card_wavefront_init(void) | |||
706 | int err; | 707 | int err; |
707 | 708 | ||
708 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); | 709 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); |
709 | if (err < 0) | ||
710 | return err; | ||
711 | #ifdef CONFIG_PNP | 710 | #ifdef CONFIG_PNP |
711 | if (!err) | ||
712 | isa_registered = 1; | ||
713 | |||
712 | err = pnp_register_card_driver(&wavefront_pnpc_driver); | 714 | err = pnp_register_card_driver(&wavefront_pnpc_driver); |
713 | if (!err) | 715 | if (!err) |
714 | pnp_registered = 1; | 716 | pnp_registered = 1; |
717 | |||
718 | if (isa_registered) | ||
719 | err = 0; | ||
715 | #endif | 720 | #endif |
716 | return 0; | 721 | return err; |
717 | } | 722 | } |
718 | 723 | ||
719 | static void __exit alsa_card_wavefront_exit(void) | 724 | static void __exit alsa_card_wavefront_exit(void) |
@@ -721,8 +726,9 @@ static void __exit alsa_card_wavefront_exit(void) | |||
721 | #ifdef CONFIG_PNP | 726 | #ifdef CONFIG_PNP |
722 | if (pnp_registered) | 727 | if (pnp_registered) |
723 | pnp_unregister_card_driver(&wavefront_pnpc_driver); | 728 | pnp_unregister_card_driver(&wavefront_pnpc_driver); |
729 | if (isa_registered) | ||
724 | #endif | 730 | #endif |
725 | isa_unregister_driver(&snd_wavefront_driver); | 731 | isa_unregister_driver(&snd_wavefront_driver); |
726 | } | 732 | } |
727 | 733 | ||
728 | module_init(alsa_card_wavefront_init) | 734 | module_init(alsa_card_wavefront_init) |