diff options
author | Rene Herman <rene.herman@gmail.com> | 2007-05-15 05:42:56 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2007-05-16 06:22:44 -0400 |
commit | 609d7694152f85734560ddc83be5e551b34d8c44 (patch) | |
tree | 14334de027169b2549933ff56cb1fd78e3bd41d6 /sound/isa/wavefront/wavefront.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/wavefront/wavefront.c')
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 75673f723857..83c2fc4cfc64 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -86,6 +86,7 @@ module_param_array(use_cs4232_midi, bool, NULL, 0444); | |||
86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); | 86 | MODULE_PARM_DESC(use_cs4232_midi, "Use CS4232 MPU-401 interface (inaccessibly located inside your computer)"); |
87 | 87 | ||
88 | #ifdef CONFIG_PNP | 88 | #ifdef CONFIG_PNP |
89 | static int isa_registered; | ||
89 | static int pnp_registered; | 90 | static int pnp_registered; |
90 | 91 | ||
91 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { | 92 | static struct pnp_card_device_id snd_wavefront_pnpids[] = { |
@@ -706,14 +707,18 @@ static int __init alsa_card_wavefront_init(void) | |||
706 | int err; | 707 | int err; |
707 | 708 | ||
708 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); | 709 | err = isa_register_driver(&snd_wavefront_driver, SNDRV_CARDS); |
709 | if (err < 0) | ||
710 | return err; | ||
711 | #ifdef CONFIG_PNP | 710 | #ifdef CONFIG_PNP |
711 | if (!err) | ||
712 | isa_registered = 1; | ||
713 | |||
712 | err = pnp_register_card_driver(&wavefront_pnpc_driver); | 714 | err = pnp_register_card_driver(&wavefront_pnpc_driver); |
713 | if (!err) | 715 | if (!err) |
714 | pnp_registered = 1; | 716 | pnp_registered = 1; |
717 | |||
718 | if (isa_registered) | ||
719 | err = 0; | ||
715 | #endif | 720 | #endif |
716 | return 0; | 721 | return err; |
717 | } | 722 | } |
718 | 723 | ||
719 | static void __exit alsa_card_wavefront_exit(void) | 724 | static void __exit alsa_card_wavefront_exit(void) |
@@ -721,8 +726,9 @@ static void __exit alsa_card_wavefront_exit(void) | |||
721 | #ifdef CONFIG_PNP | 726 | #ifdef CONFIG_PNP |
722 | if (pnp_registered) | 727 | if (pnp_registered) |
723 | pnp_unregister_card_driver(&wavefront_pnpc_driver); | 728 | pnp_unregister_card_driver(&wavefront_pnpc_driver); |
729 | if (isa_registered) | ||
724 | #endif | 730 | #endif |
725 | isa_unregister_driver(&snd_wavefront_driver); | 731 | isa_unregister_driver(&snd_wavefront_driver); |
726 | } | 732 | } |
727 | 733 | ||
728 | module_init(alsa_card_wavefront_init) | 734 | module_init(alsa_card_wavefront_init) |