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