X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=sound%2Fdrivers%2Fvirmidi.c;h=59171f8200dfb8fd1dd957e5bb37dd273d292b79;hb=c730f5b621afa33e9f4939da9078669162ebff4e;hp=a3ee306239c92930f4a1baaf86b0bde96a977138;hpb=be9bf30c73184e0f1e4e0a50fb193d2a551bf75e;p=linux-2.6-omap-h63xx.git diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index a3ee306239c..59171f8200d 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c @@ -169,9 +169,11 @@ static int __init alsa_card_virmidi_init(void) continue; device = platform_device_register_simple(SND_VIRMIDI_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++; @@ -180,14 +182,10 @@ static int __init alsa_card_virmidi_init(void) #ifdef MODULE printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); #endif - err = -ENODEV; - goto errout; + snd_virmidi_unregister_all(); + return -ENODEV; } return 0; - - errout: - snd_virmidi_unregister_all(); - return err; } static void __exit alsa_card_virmidi_exit(void)