diff options
Diffstat (limited to 'sound/isa/cs423x/cs4236.c')
-rw-r--r-- | sound/isa/cs423x/cs4236.c | 20 |
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); | |||
127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); | 127 | MODULE_PARM_DESC(dma2, "DMA2 # for " IDENT " driver."); |
128 | 128 | ||
129 | #ifdef CONFIG_PNP | 129 | #ifdef CONFIG_PNP |
130 | static int isa_registered; | ||
130 | static int pnpc_registered; | 131 | static int pnpc_registered; |
131 | #ifdef CS4232 | 132 | #ifdef CS4232 |
132 | static int pnp_registered; | 133 | static 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 | ||
788 | static void __exit alsa_card_cs423x_exit(void) | 795 | static 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 | ||
801 | module_init(alsa_card_cs423x_init) | 809 | module_init(alsa_card_cs423x_init) |