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/opl3sa2.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/opl3sa2.c')
-rw-r--r-- | sound/isa/opl3sa2.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c index 48743eb85fb6..61a323cc0e49 100644 --- a/sound/isa/opl3sa2.c +++ b/sound/isa/opl3sa2.c | |||
@@ -92,6 +92,7 @@ module_param_array(opl3sa3_ymode, int, NULL, 0444); | |||
92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); | 92 | MODULE_PARM_DESC(opl3sa3_ymode, "Speaker size selection for 3D Enhancement mode: Desktop/Large Notebook/Small Notebook/HiFi."); |
93 | 93 | ||
94 | #ifdef CONFIG_PNP | 94 | #ifdef CONFIG_PNP |
95 | static int isa_registered; | ||
95 | static int pnp_registered; | 96 | static int pnp_registered; |
96 | static int pnpc_registered; | 97 | static int pnpc_registered; |
97 | #endif | 98 | #endif |
@@ -967,17 +968,22 @@ static int __init alsa_card_opl3sa2_init(void) | |||
967 | int err; | 968 | int err; |
968 | 969 | ||
969 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); | 970 | err = isa_register_driver(&snd_opl3sa2_isa_driver, SNDRV_CARDS); |
970 | if (err < 0) | ||
971 | return err; | ||
972 | #ifdef CONFIG_PNP | 971 | #ifdef CONFIG_PNP |
972 | if (!err) | ||
973 | isa_registered = 1; | ||
974 | |||
973 | err = pnp_register_driver(&opl3sa2_pnp_driver); | 975 | err = pnp_register_driver(&opl3sa2_pnp_driver); |
974 | if (!err) | 976 | if (!err) |
975 | pnp_registered = 1; | 977 | pnp_registered = 1; |
978 | |||
976 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); | 979 | err = pnp_register_card_driver(&opl3sa2_pnpc_driver); |
977 | if (!err) | 980 | if (!err) |
978 | pnpc_registered = 1; | 981 | pnpc_registered = 1; |
982 | |||
983 | if (isa_registered || pnp_registered) | ||
984 | err = 0; | ||
979 | #endif | 985 | #endif |
980 | return 0; | 986 | return err; |
981 | } | 987 | } |
982 | 988 | ||
983 | static void __exit alsa_card_opl3sa2_exit(void) | 989 | static void __exit alsa_card_opl3sa2_exit(void) |
@@ -987,8 +993,9 @@ static void __exit alsa_card_opl3sa2_exit(void) | |||
987 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); | 993 | pnp_unregister_card_driver(&opl3sa2_pnpc_driver); |
988 | if (pnp_registered) | 994 | if (pnp_registered) |
989 | pnp_unregister_driver(&opl3sa2_pnp_driver); | 995 | pnp_unregister_driver(&opl3sa2_pnp_driver); |
996 | if (isa_registered) | ||
990 | #endif | 997 | #endif |
991 | isa_unregister_driver(&snd_opl3sa2_isa_driver); | 998 | isa_unregister_driver(&snd_opl3sa2_isa_driver); |
992 | } | 999 | } |
993 | 1000 | ||
994 | module_init(alsa_card_opl3sa2_init) | 1001 | module_init(alsa_card_opl3sa2_init) |