X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=sound%2Fisa%2Fes1688%2Fes1688.c;h=e90689ee162fac5174a3d4413cec954d6675fa40;hb=d90125bfe958ed0451c6b98f831c86aba08b43d5;hp=50d23cf3d7ccea2fd58a7c919941c40401569c03;hpb=29552b1462799afbe02af035b243e97579d63350;p=linux-2.6 diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c index 50d23cf3d7..e90689ee16 100644 --- a/sound/isa/es1688/es1688.c +++ b/sound/isa/es1688/es1688.c @@ -207,13 +207,17 @@ static int __init alsa_card_es1688_init(void) return err; cards = 0; - for (i = 0; i < SNDRV_CARDS && enable[i]; i++) { + for (i = 0; i < SNDRV_CARDS; i++) { struct platform_device *device; + if (! enable[i]) + continue; device = platform_device_register_simple(ES1688_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; } devices[i] = device; cards++; @@ -222,14 +226,10 @@ static int __init alsa_card_es1688_init(void) #ifdef MODULE printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); #endif - err = -ENODEV; - goto errout; + snd_es1688_unregister_all(); + return -ENODEV; } return 0; - - errout: - snd_es1688_unregister_all(); - return err; } static void __exit alsa_card_es1688_exit(void)