diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:11:23 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:11:23 -0400 |
commit | 7b7e394185014e0f3bd8989cac937003f20ef9ce (patch) | |
tree | 3beda5f979bba0aa9822534e239cf1b45f3be69c /sound/isa/cmi8330.c | |
parent | ddc5d3414593e4d7ad7fbd33e7f7517fcc234544 (diff) | |
parent | 693f7d362055261882659475d2ef022e32edbff1 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'sound/isa/cmi8330.c')
-rw-r--r-- | sound/isa/cmi8330.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c index fa63048a8b9..3c1e9fd56fe 100644 --- a/sound/isa/cmi8330.c +++ b/sound/isa/cmi8330.c @@ -693,15 +693,17 @@ static int __init alsa_card_cmi8330_init(void) if ((err = platform_driver_register(&snd_cmi8330_driver)) < 0) return err; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; - if (is_isapnp_selected(i)) + if (! enable[i] || is_isapnp_selected(i)) continue; device = platform_device_register_simple(CMI8330_DRIVER, i, NULL, 0); - if (IS_ERR(device)) { - err = PTR_ERR(device); - goto errout; + if (IS_ERR(device)) + continue; + if (!platform_get_drvdata(device)) { + platform_device_unregister(device); + continue; } platform_devices[i] = device; cards++; @@ -719,14 +721,10 @@ static int __init alsa_card_cmi8330_init(void) #ifdef MODULE snd_printk(KERN_ERR "CMI8330 not found or device busy\n"); #endif - err = -ENODEV; - goto errout; + snd_cmi8330_unregister_all(); + return -ENODEV; } return 0; - - errout: - snd_cmi8330_unregister_all(); - return err; } static void __exit alsa_card_cmi8330_exit(void) |