aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/es18xx.c
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/es18xx.c
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/es18xx.c')
-rw-r--r--sound/isa/es18xx.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index d2a9c7df0ce5..f7732bf90be3 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2036,7 +2036,9 @@ module_param_array(dma2, int, NULL, 0444);
2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver."); 2036MODULE_PARM_DESC(dma2, "DMA 2 # for ES18xx driver.");
2037 2037
2038#ifdef CONFIG_PNP 2038#ifdef CONFIG_PNP
2039static int pnp_registered, pnpc_registered; 2039static int isa_registered;
2040static int pnp_registered;
2041static int pnpc_registered;
2040 2042
2041static struct pnp_device_id snd_audiodrive_pnpbiosids[] = { 2043static struct pnp_device_id snd_audiodrive_pnpbiosids[] = {
2042 { .id = "ESS1869" }, 2044 { .id = "ESS1869" },
@@ -2466,18 +2468,22 @@ static int __init alsa_card_es18xx_init(void)
2466 int err; 2468 int err;
2467 2469
2468 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS); 2470 err = isa_register_driver(&snd_es18xx_isa_driver, SNDRV_CARDS);
2469 if (err < 0)
2470 return err;
2471
2472#ifdef CONFIG_PNP 2471#ifdef CONFIG_PNP
2472 if (!err)
2473 isa_registered = 1;
2474
2473 err = pnp_register_driver(&es18xx_pnp_driver); 2475 err = pnp_register_driver(&es18xx_pnp_driver);
2474 if (!err) 2476 if (!err)
2475 pnp_registered = 1; 2477 pnp_registered = 1;
2478
2476 err = pnp_register_card_driver(&es18xx_pnpc_driver); 2479 err = pnp_register_card_driver(&es18xx_pnpc_driver);
2477 if (!err) 2480 if (!err)
2478 pnpc_registered = 1; 2481 pnpc_registered = 1;
2482
2483 if (isa_registered || pnp_registered)
2484 err = 0;
2479#endif 2485#endif
2480 return 0; 2486 return err;
2481} 2487}
2482 2488
2483static void __exit alsa_card_es18xx_exit(void) 2489static void __exit alsa_card_es18xx_exit(void)
@@ -2487,8 +2493,9 @@ static void __exit alsa_card_es18xx_exit(void)
2487 pnp_unregister_card_driver(&es18xx_pnpc_driver); 2493 pnp_unregister_card_driver(&es18xx_pnpc_driver);
2488 if (pnp_registered) 2494 if (pnp_registered)
2489 pnp_unregister_driver(&es18xx_pnp_driver); 2495 pnp_unregister_driver(&es18xx_pnp_driver);
2496 if (isa_registered)
2490#endif 2497#endif
2491 isa_unregister_driver(&snd_es18xx_isa_driver); 2498 isa_unregister_driver(&snd_es18xx_isa_driver);
2492} 2499}
2493 2500
2494module_init(alsa_card_es18xx_init) 2501module_init(alsa_card_es18xx_init)