aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/sgalaxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/sgalaxy.c')
-rw-r--r--sound/isa/sgalaxy.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c
index a60e66afbf90..f01a80a97ab8 100644
--- a/sound/isa/sgalaxy.c
+++ b/sound/isa/sgalaxy.c
@@ -366,10 +366,8 @@ static int __init alsa_card_sgalaxy_init(void)
366 continue; 366 continue;
367 device = platform_device_register_simple(SND_SGALAXY_DRIVER, 367 device = platform_device_register_simple(SND_SGALAXY_DRIVER,
368 i, NULL, 0); 368 i, NULL, 0);
369 if (IS_ERR(device)) { 369 if (IS_ERR(device))
370 err = PTR_ERR(device); 370 continue;
371 goto errout;
372 }
373 devices[i] = device; 371 devices[i] = device;
374 cards++; 372 cards++;
375 } 373 }
@@ -377,14 +375,10 @@ static int __init alsa_card_sgalaxy_init(void)
377#ifdef MODULE 375#ifdef MODULE
378 snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); 376 snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n");
379#endif 377#endif
380 err = -ENODEV; 378 snd_sgalaxy_unregister_all();
381 goto errout; 379 return -ENODEV;
382 } 380 }
383 return 0; 381 return 0;
384
385 errout:
386 snd_sgalaxy_unregister_all();
387 return err;
388} 382}
389 383
390static void __exit alsa_card_sgalaxy_exit(void) 384static void __exit alsa_card_sgalaxy_exit(void)