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/gus/interwave.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/gus/interwave.c')
-rw-r--r-- | sound/isa/gus/interwave.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c index 3e4657255536..0220cdbe1a2a 100644 --- a/sound/isa/gus/interwave.c +++ b/sound/isa/gus/interwave.c | |||
@@ -135,6 +135,7 @@ struct snd_interwave { | |||
135 | 135 | ||
136 | 136 | ||
137 | #ifdef CONFIG_PNP | 137 | #ifdef CONFIG_PNP |
138 | static int isa_registered; | ||
138 | static int pnp_registered; | 139 | static int pnp_registered; |
139 | 140 | ||
140 | static struct pnp_card_device_id snd_interwave_pnpids[] = { | 141 | static struct pnp_card_device_id snd_interwave_pnpids[] = { |
@@ -934,15 +935,18 @@ static int __init alsa_card_interwave_init(void) | |||
934 | int err; | 935 | int err; |
935 | 936 | ||
936 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); | 937 | err = isa_register_driver(&snd_interwave_driver, SNDRV_CARDS); |
937 | if (err < 0) | ||
938 | return err; | ||
939 | #ifdef CONFIG_PNP | 938 | #ifdef CONFIG_PNP |
940 | /* ISA PnP cards */ | 939 | if (!err) |
940 | isa_registered = 1; | ||
941 | |||
941 | err = pnp_register_card_driver(&interwave_pnpc_driver); | 942 | err = pnp_register_card_driver(&interwave_pnpc_driver); |
942 | if (!err) | 943 | if (!err) |
943 | pnp_registered = 1; | 944 | pnp_registered = 1; |
945 | |||
946 | if (isa_registered) | ||
947 | err = 0; | ||
944 | #endif | 948 | #endif |
945 | return 0; | 949 | return err; |
946 | } | 950 | } |
947 | 951 | ||
948 | static void __exit alsa_card_interwave_exit(void) | 952 | static void __exit alsa_card_interwave_exit(void) |
@@ -950,8 +954,9 @@ static void __exit alsa_card_interwave_exit(void) | |||
950 | #ifdef CONFIG_PNP | 954 | #ifdef CONFIG_PNP |
951 | if (pnp_registered) | 955 | if (pnp_registered) |
952 | pnp_unregister_card_driver(&interwave_pnpc_driver); | 956 | pnp_unregister_card_driver(&interwave_pnpc_driver); |
957 | if (isa_registered) | ||
953 | #endif | 958 | #endif |
954 | isa_unregister_driver(&snd_interwave_driver); | 959 | isa_unregister_driver(&snd_interwave_driver); |
955 | } | 960 | } |
956 | 961 | ||
957 | module_init(alsa_card_interwave_init) | 962 | module_init(alsa_card_interwave_init) |