summaryrefslogtreecommitdiff
path: root/sound/isa/gus/interwave.c
diff options
context:
space:
mode:
authorRene Herman <rene.herman@gmail.com>2007-05-15 09:42:56 (GMT)
committerJaroslav Kysela <perex@suse.cz>2007-05-16 10:22:44 (GMT)
commit609d7694152f85734560ddc83be5e551b34d8c44 (patch)
tree14334de027169b2549933ff56cb1fd78e3bd41d6 /sound/isa/gus/interwave.c
parent60af15f529d22a93805e74dd3c52b6f8134511d2 (diff)
downloadlinux-609d7694152f85734560ddc83be5e551b34d8c44.tar.xz
[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/gus/interwave.c')
-rw-r--r--sound/isa/gus/interwave.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index 3e46572..0220cdb 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -135,6 +135,7 @@ struct snd_interwave {
#ifdef CONFIG_PNP
+static int isa_registered;
static int pnp_registered;
static struct pnp_card_device_id snd_interwave_pnpids[] = {
@@ -934,15 +935,18 @@ static int __init alsa_card_interwave_init(void)
int err;
err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS);
- if (err < 0)
- return err;
#ifdef CONFIG_PNP
- /* ISA PnP cards */
+ if (!err)
+ isa_registered = 1;
+
err = pnp_register_card_driver(&interwave_pnpc_driver);
if (!err)
pnp_registered = 1;
+
+ if (isa_registered)
+ err = 0;
#endif
- return 0;
+ return err;
}
static void __exit alsa_card_interwave_exit(void)
@@ -950,8 +954,9 @@ static void __exit alsa_card_interwave_exit(void)
#ifdef CONFIG_PNP
if (pnp_registered)
pnp_unregister_card_driver(&interwave_pnpc_driver);
+ if (isa_registered)
#endif
- isa_unregister_driver(&snd_interwave_driver);
+ isa_unregister_driver(&snd_interwave_driver);
}
module_init(alsa_card_interwave_init)