diff options
author | Rene Herman <rene.herman@gmail.com> | 2007-05-15 11:42:56 +0200 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-16 12:22:44 +0200 |
commit | 609d7694152f85734560ddc83be5e551b34d8c44 (patch) | |
tree | 14334de027169b2549933ff56cb1fd78e3bd41d6 /sound/isa/sb/sb16.c | |
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>
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 2a19b0a39ed..c4ba24bfd27 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."); #endif #ifdef CONFIG_PNP +static int isa_registered; static int pnp_registered; #endif @@ -702,15 +703,18 @@ static int __init alsa_card_sb16_init(void) int err; err = isa_register_driver(&snd_sb16_isa_driver, SNDRV_CARDS); - if (err < 0) - return err; #ifdef CONFIG_PNP - /* PnP cards at last */ + if (!err) + isa_registered = 1; + err = pnp_register_card_driver(&sb16_pnpc_driver); if (!err) pnp_registered = 1; + + if (isa_registered) + err = 0; #endif - return 0; + return err; } static void __exit alsa_card_sb16_exit(void) @@ -718,8 +722,9 @@ static void __exit alsa_card_sb16_exit(void) #ifdef CONFIG_PNP if (pnp_registered) pnp_unregister_card_driver(&sb16_pnpc_driver); + if (isa_registered) #endif - isa_unregister_driver(&snd_sb16_isa_driver); + isa_unregister_driver(&snd_sb16_isa_driver); } module_init(alsa_card_sb16_init) |