aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cmi8330.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/cmi8330.c')
-rw-r--r--sound/isa/cmi8330.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/isa/cmi8330.c b/sound/isa/cmi8330.c
index bc0f5ebf5d3c..3c1e9fd56fe0 100644
--- a/sound/isa/cmi8330.c
+++ b/sound/isa/cmi8330.c
@@ -699,9 +699,11 @@ static int __init alsa_card_cmi8330_init(void)
699 continue; 699 continue;
700 device = platform_device_register_simple(CMI8330_DRIVER, 700 device = platform_device_register_simple(CMI8330_DRIVER,
701 i, NULL, 0); 701 i, NULL, 0);
702 if (IS_ERR(device)) { 702 if (IS_ERR(device))
703 err = PTR_ERR(device); 703 continue;
704 goto errout; 704 if (!platform_get_drvdata(device)) {
705 platform_device_unregister(device);
706 continue;
705 } 707 }
706 platform_devices[i] = device; 708 platform_devices[i] = device;
707 cards++; 709 cards++;
@@ -719,14 +721,10 @@ static int __init alsa_card_cmi8330_init(void)
719#ifdef MODULE 721#ifdef MODULE
720 snd_printk(KERN_ERR "CMI8330 not found or device busy\n"); 722 snd_printk(KERN_ERR "CMI8330 not found or device busy\n");
721#endif 723#endif
722 err = -ENODEV; 724 snd_cmi8330_unregister_all();
723 goto errout; 725 return -ENODEV;
724 } 726 }
725 return 0; 727 return 0;
726
727 errout:
728 snd_cmi8330_unregister_all();
729 return err;
730} 728}
731 729
732static void __exit alsa_card_cmi8330_exit(void) 730static void __exit alsa_card_cmi8330_exit(void)