aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sscape.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sscape.c')
-rw-r--r--sound/isa/sscape.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 08c14978558c..9ea417bcf3e5 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -69,7 +69,9 @@ module_param_array(dma, int, NULL, 0444);
69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); 69MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
70 70
71#ifdef CONFIG_PNP 71#ifdef CONFIG_PNP
72static int isa_registered;
72static int pnp_registered; 73static int pnp_registered;
74
73static struct pnp_card_device_id sscape_pnpids[] = { 75static struct pnp_card_device_id sscape_pnpids[] = {
74 { .id = "ENS3081", .devs = { { "ENS0000" } } }, 76 { .id = "ENS3081", .devs = { { "ENS0000" } } },
75 { .id = "" } /* end */ 77 { .id = "" } /* end */
@@ -1405,22 +1407,21 @@ static struct pnp_card_driver sscape_pnpc_driver = {
1405 1407
1406static int __init sscape_init(void) 1408static int __init sscape_init(void)
1407{ 1409{
1408 int ret; 1410 int err;
1409 1411
1410 /* 1412 err = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);
1411 * First check whether we were passed any parameters.
1412 * These MUST take precedence over ANY automatic way
1413 * of allocating cards, because the operator is
1414 * S-P-E-L-L-I-N-G it out for us...
1415 */
1416 ret = isa_register_driver(&snd_sscape_driver, SNDRV_CARDS);
1417 if (ret < 0)
1418 return ret;
1419#ifdef CONFIG_PNP 1413#ifdef CONFIG_PNP
1420 if (pnp_register_card_driver(&sscape_pnpc_driver) == 0) 1414 if (!err)
1415 isa_registered = 1;
1416
1417 err = pnp_register_card_driver(&sscape_pnpc_driver);
1418 if (!err)
1421 pnp_registered = 1; 1419 pnp_registered = 1;
1420
1421 if (isa_registered)
1422 err = 0;
1422#endif 1423#endif
1423 return 0; 1424 return err;
1424} 1425}
1425 1426
1426static void __exit sscape_exit(void) 1427static void __exit sscape_exit(void)
@@ -1428,8 +1429,9 @@ static void __exit sscape_exit(void)
1428#ifdef CONFIG_PNP 1429#ifdef CONFIG_PNP
1429 if (pnp_registered) 1430 if (pnp_registered)
1430 pnp_unregister_card_driver(&sscape_pnpc_driver); 1431 pnp_unregister_card_driver(&sscape_pnpc_driver);
1432 if (isa_registered)
1431#endif 1433#endif
1432 isa_unregister_driver(&snd_sscape_driver); 1434 isa_unregister_driver(&snd_sscape_driver);
1433} 1435}
1434 1436
1435module_init(sscape_init); 1437module_init(sscape_init);