aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x
diff options
context:
space:
mode:
authorRene Herman <rene.herman@gmail.com>2007-05-15 05:42:56 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-16 06:22:44 -0400
commit609d7694152f85734560ddc83be5e551b34d8c44 (patch)
tree14334de027169b2549933ff56cb1fd78e3bd41d6 /sound/isa/cs423x
parent60af15f529d22a93805e74dd3c52b6f8134511d2 (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/cs423x')
-rw-r--r--sound/isa/cs423x/cs4236.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 87f1392a2fa7..1a14f33b6ab0 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -127,6 +127,7 @@ module_param_array(dma2, int, NULL, 0444);
127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); 127MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver.");
128 128
129#ifdef CONFIG_PNP 129#ifdef CONFIG_PNP
130static int isa_registered;
130static int pnpc_registered; 131static int pnpc_registered;
131#ifdef CS4232 132#ifdef CS4232
132static int pnp_registered; 133static int pnp_registered;
@@ -770,9 +771,9 @@ static int __init alsa_card_cs423x_init(void)
770 int err; 771 int err;
771 772
772 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS); 773 err = isa_register_driver(&cs423x_isa_driver, SNDRV_CARDS);
773 if (err < 0)
774 return err;
775#ifdef CONFIG_PNP 774#ifdef CONFIG_PNP
775 if (!err)
776 isa_registered = 1;
776#ifdef CS4232 777#ifdef CS4232
777 err = pnp_register_driver(&cs4232_pnp_driver); 778 err = pnp_register_driver(&cs4232_pnp_driver);
778 if (!err) 779 if (!err)
@@ -781,8 +782,14 @@ static int __init alsa_card_cs423x_init(void)
781 err = pnp_register_card_driver(&cs423x_pnpc_driver); 782 err = pnp_register_card_driver(&cs423x_pnpc_driver);
782 if (!err) 783 if (!err)
783 pnpc_registered = 1; 784 pnpc_registered = 1;
784#endif /* CONFIG_PNP */ 785#ifdef CS4232
785 return 0; 786 if (pnp_registered)
787 err = 0;
788#endif
789 if (isa_registered)
790 err = 0;
791#endif
792 return err;
786} 793}
787 794
788static void __exit alsa_card_cs423x_exit(void) 795static void __exit alsa_card_cs423x_exit(void)
@@ -794,8 +801,9 @@ static void __exit alsa_card_cs423x_exit(void)
794 if (pnp_registered) 801 if (pnp_registered)
795 pnp_unregister_driver(&cs4232_pnp_driver); 802 pnp_unregister_driver(&cs4232_pnp_driver);
796#endif 803#endif
797#endif /* CONFIG_PNP */ 804 if (isa_registered)
798 isa_unregister_driver(&cs423x_isa_driver); 805#endif
806 isa_unregister_driver(&cs423x_isa_driver);
799} 807}
800 808
801module_init(alsa_card_cs423x_init) 809module_init(alsa_card_cs423x_init)