diff options
Diffstat (limited to 'sound/isa/wavefront/wavefront.c')
-rw-r--r-- | sound/isa/wavefront/wavefront.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/isa/wavefront/wavefront.c b/sound/isa/wavefront/wavefront.c index 2f13cd5d4dcb..7ae86f82c3fa 100644 --- a/sound/isa/wavefront/wavefront.c +++ b/sound/isa/wavefront/wavefront.c | |||
@@ -722,9 +722,11 @@ static int __init alsa_card_wavefront_init(void) | |||
722 | #endif | 722 | #endif |
723 | device = platform_device_register_simple(WAVEFRONT_DRIVER, | 723 | device = platform_device_register_simple(WAVEFRONT_DRIVER, |
724 | i, NULL, 0); | 724 | i, NULL, 0); |
725 | if (IS_ERR(device)) { | 725 | if (IS_ERR(device)) |
726 | err = PTR_ERR(device); | 726 | continue; |
727 | goto errout; | 727 | if (!platform_get_drvdata(device)) { |
728 | platform_device_unregister(device); | ||
729 | continue; | ||
728 | } | 730 | } |
729 | platform_devices[i] = device; | 731 | platform_devices[i] = device; |
730 | cards++; | 732 | cards++; |
@@ -742,14 +744,10 @@ static int __init alsa_card_wavefront_init(void) | |||
742 | #ifdef MODULE | 744 | #ifdef MODULE |
743 | printk (KERN_ERR "No WaveFront cards found or devices busy\n"); | 745 | printk (KERN_ERR "No WaveFront cards found or devices busy\n"); |
744 | #endif | 746 | #endif |
745 | err = -ENODEV; | 747 | snd_wavefront_unregister_all(); |
746 | goto errout; | 748 | return -ENODEV; |
747 | } | 749 | } |
748 | return 0; | 750 | return 0; |
749 | |||
750 | errout: | ||
751 | snd_wavefront_unregister_all(); | ||
752 | return err; | ||
753 | } | 751 | } |
754 | 752 | ||
755 | static void __exit alsa_card_wavefront_exit(void) | 753 | static void __exit alsa_card_wavefront_exit(void) |