aboutsummaryrefslogtreecommitdiffstats
path: root/sound/drivers/virmidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/drivers/virmidi.c')
-rw-r--r--sound/drivers/virmidi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c
index a3ee306239c9..26eb2499d442 100644
--- a/sound/drivers/virmidi.c
+++ b/sound/drivers/virmidi.c
@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void)
169 continue; 169 continue;
170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER, 170 device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
171 i, NULL, 0); 171 i, NULL, 0);
172 if (IS_ERR(device)) { 172 if (IS_ERR(device))
173 err = PTR_ERR(device); 173 continue;
174 goto errout;
175 }
176 devices[i] = device; 174 devices[i] = device;
177 cards++; 175 cards++;
178 } 176 }
@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void)
180#ifdef MODULE 178#ifdef MODULE
181 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); 179 printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
182#endif 180#endif
183 err = -ENODEV; 181 snd_virmidi_unregister_all();
184 goto errout; 182 return -ENODEV;
185 } 183 }
186 return 0; 184 return 0;
187
188 errout:
189 snd_virmidi_unregister_all();
190 return err;
191} 185}
192 186
193static void __exit alsa_card_virmidi_exit(void) 187static void __exit alsa_card_virmidi_exit(void)