diff options
Diffstat (limited to 'sound/isa/sb/sb16.c')
-rw-r--r-- | sound/isa/sb/sb16.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/isa/sb/sb16.c b/sound/isa/sb/sb16.c index 21ea65925a9e..6333f900eaee 100644 --- a/sound/isa/sb/sb16.c +++ b/sound/isa/sb/sb16.c | |||
@@ -720,9 +720,11 @@ static int __init alsa_card_sb16_init(void) | |||
720 | continue; | 720 | continue; |
721 | device = platform_device_register_simple(SND_SB16_DRIVER, | 721 | device = platform_device_register_simple(SND_SB16_DRIVER, |
722 | i, NULL, 0); | 722 | i, NULL, 0); |
723 | if (IS_ERR(device)) { | 723 | if (IS_ERR(device)) |
724 | err = PTR_ERR(device); | 724 | continue; |
725 | goto errout; | 725 | if (!platform_get_drvdata(device)) { |
726 | platform_device_unregister(device); | ||
727 | continue; | ||
726 | } | 728 | } |
727 | platform_devices[i] = device; | 729 | platform_devices[i] = device; |
728 | cards++; | 730 | cards++; |
@@ -745,14 +747,10 @@ static int __init alsa_card_sb16_init(void) | |||
745 | snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n"); | 747 | snd_printk(KERN_ERR "In case, if you have AWE card, try snd-sbawe module\n"); |
746 | #endif | 748 | #endif |
747 | #endif | 749 | #endif |
748 | err = -ENODEV; | 750 | snd_sb16_unregister_all(); |
749 | goto errout; | 751 | return -ENODEV; |
750 | } | 752 | } |
751 | return 0; | 753 | return 0; |
752 | |||
753 | errout: | ||
754 | snd_sb16_unregister_all(); | ||
755 | return err; | ||
756 | } | 754 | } |
757 | 755 | ||
758 | static void __exit alsa_card_sb16_exit(void) | 756 | static void __exit alsa_card_sb16_exit(void) |