diff options
Diffstat (limited to 'sound/isa/sgalaxy.c')
-rw-r--r-- | sound/isa/sgalaxy.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/isa/sgalaxy.c b/sound/isa/sgalaxy.c index a60e66afbf90..09c8e8c6b5e3 100644 --- a/sound/isa/sgalaxy.c +++ b/sound/isa/sgalaxy.c | |||
@@ -366,9 +366,11 @@ 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; | 371 | if (!platform_get_drvdata(device)) { |
372 | platform_device_unregister(device); | ||
373 | continue; | ||
372 | } | 374 | } |
373 | devices[i] = device; | 375 | devices[i] = device; |
374 | cards++; | 376 | cards++; |
@@ -377,14 +379,10 @@ static int __init alsa_card_sgalaxy_init(void) | |||
377 | #ifdef MODULE | 379 | #ifdef MODULE |
378 | snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); | 380 | snd_printk(KERN_ERR "Sound Galaxy soundcard not found or device busy\n"); |
379 | #endif | 381 | #endif |
380 | err = -ENODEV; | 382 | snd_sgalaxy_unregister_all(); |
381 | goto errout; | 383 | return -ENODEV; |
382 | } | 384 | } |
383 | return 0; | 385 | return 0; |
384 | |||
385 | errout: | ||
386 | snd_sgalaxy_unregister_all(); | ||
387 | return err; | ||
388 | } | 386 | } |
389 | 387 | ||
390 | static void __exit alsa_card_sgalaxy_exit(void) | 388 | static void __exit alsa_card_sgalaxy_exit(void) |