diff options
Diffstat (limited to 'sound/isa/gus/interwave.c')
-rw-r--r-- | sound/isa/gus/interwave.c | 15 |
1 files changed, 10 insertions, 5 deletions
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) |