diff options
Diffstat (limited to 'sound/isa/cmi8330.c')
-rw-r--r-- | sound/isa/cmi8330.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index 214d65d94c45..f471f8ad6885 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c | |||
@@ -109,6 +109,7 @@ module_param_array(wssdma, int, NULL, 0444); | |||
109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); | 109 | MODULE_PARM_DESC(wssdma, "DMA for CMI8330 WSS driver."); |
110 | 110 | ||
111 | #ifdef CONFIG_PNP | 111 | #ifdef CONFIG_PNP |
112 | static int isa_registered; | ||
112 | static int pnp_registered; | 113 | static int pnp_registered; |
113 | #endif | 114 | #endif |
114 | 115 | ||
@@ -686,14 +687,18 @@ static int __init alsa_card_cmi8330_init(void) | |||
686 | int err; | 687 | int err; |
687 | 688 | ||
688 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); | 689 | err = isa_register_driver(&snd_cmi8330_driver, SNDRV_CARDS); |
689 | if (err < 0) | ||
690 | return err; | ||
691 | #ifdef CONFIG_PNP | 690 | #ifdef CONFIG_PNP |
691 | if (!err) | ||
692 | isa_registered = 1; | ||
693 | |||
692 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); | 694 | err = pnp_register_card_driver(&cmi8330_pnpc_driver); |
693 | if (!err) | 695 | if (!err) |
694 | pnp_registered = 1; | 696 | pnp_registered = 1; |
697 | |||
698 | if (isa_registered) | ||
699 | err = 0; | ||
695 | #endif | 700 | #endif |
696 | return 0; | 701 | return err; |
697 | } | 702 | } |
698 | 703 | ||
699 | static void __exit alsa_card_cmi8330_exit(void) | 704 | static void __exit alsa_card_cmi8330_exit(void) |
@@ -701,8 +706,10 @@ static void __exit alsa_card_cmi8330_exit(void) | |||
701 | #ifdef CONFIG_PNP | 706 | #ifdef CONFIG_PNP |
702 | if (pnp_registered) | 707 | if (pnp_registered) |
703 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); | 708 | pnp_unregister_card_driver(&cmi8330_pnpc_driver); |
709 | |||
710 | if (isa_registered) | ||
704 | #endif | 711 | #endif |
705 | isa_unregister_driver(&snd_cmi8330_driver); | 712 | isa_unregister_driver(&snd_cmi8330_driver); |
706 | } | 713 | } |
707 | 714 | ||
708 | module_init(alsa_card_cmi8330_init) | 715 | module_init(alsa_card_cmi8330_init) |