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/sscape.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/sscape.c')
-rw-r--r-- | sound/isa/sscape.c | 28 |
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); | |||
69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); | 69 | MODULE_PARM_DESC(dma, "DMA # for SoundScape driver."); |
70 | 70 | ||
71 | #ifdef CONFIG_PNP | 71 | #ifdef CONFIG_PNP |
72 | static int isa_registered; | ||
72 | static int pnp_registered; | 73 | static int pnp_registered; |
74 | |||
73 | static struct pnp_card_device_id sscape_pnpids[] = { | 75 | static 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 | ||
1406 | static int __init sscape_init(void) | 1408 | static 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 | ||
1426 | static void __exit sscape_exit(void) | 1427 | static 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 | ||
1435 | module_init(sscape_init); | 1437 | module_init(sscape_init); |