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/cs423x | |
parent | 60af15f529d22a93805e74dd3c52b6f8134511d2 (diff) | |
download | op-kernel-dev-609d7694152f85734560ddc83be5e551b34d8c44.zip op-kernel-dev-609d7694152f85734560ddc83be5e551b34d8c44.tar.gz |
[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/cs423x')
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c index 87f1392..1a14f33 100644 --- a/sound/isa/cs423x/cs4236.c +++ b/sound/isa/cs423x/cs4236.c @@ -127,6 +127,7 @@ module_param_array(dma2, int, NULL, 0444); MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); #ifdef CONFIG_PNP +static int isa_registered; static int pnpc_registered; #ifdef CS4232 static int pnp_registered; @@ -770,9 +771,9 @@ static int __init alsa_card_cs423x_init(void) int err; err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); - if (err < 0) - return err; #ifdef CONFIG_PNP + if (!err) + isa_registered = 1; #ifdef CS4232 err = pnp_register_driver(&cs4232_pnp_driver); if (!err) @@ -781,8 +782,14 @@ static int __init alsa_card_cs423x_init(void) err = pnp_register_card_driver(&cs423x_pnpc_driver); if (!err) pnpc_registered = 1; -#endif /* CONFIG_PNP */ - return 0; +#ifdef CS4232 + if (pnp_registered) + err = 0; +#endif + if (isa_registered) + err = 0; +#endif + return err; } static void __exit alsa_card_cs423x_exit(void) @@ -794,8 +801,9 @@ static void __exit alsa_card_cs423x_exit(void) if (pnp_registered) pnp_unregister_driver(&cs4232_pnp_driver); #endif -#endif /* CONFIG_PNP */ - isa_unregister_driver(&cs423x_isa_driver); + if (isa_registered) +#endif + isa_unregister_driver(&cs423x_isa_driver); } module_init(alsa_card_cs423x_init) |