aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-04-21 12:52:36 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2006-04-21 12:52:36 -0400
commita748422ee45725e04e1d3792fa19dfa90ddfd116 (patch)
tree978e12895468baaa9f7ab2747b9f7d50beaf1717 /sound/isa
parentc63e31c2cc1ec67372920b5e1aff8204d04dd172 (diff)
parentf4ffaa452e71495a06376f12f772342bc57051fc (diff)
Merge branch 'master'
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1848/ad1848.c16
-rw-r--r--sound/isa/adlib.c11
-rw-r--r--sound/isa/cmi8330.c16
-rw-r--r--sound/isa/cs423x/cs4231.c16
-rw-r--r--sound/isa/cs423x/cs4236.c16
-rw-r--r--sound/isa/es1688/es1688.c16
-rw-r--r--sound/isa/es18xx.c16
-rw-r--r--sound/isa/gus/gusclassic.c16
-rw-r--r--sound/isa/gus/gusextreme.c16
-rw-r--r--sound/isa/gus/gusmax.c16
-rw-r--r--sound/isa/gus/interwave.c16
-rw-r--r--sound/isa/opl3sa2.c16
-rw-r--r--sound/isa/opti9xx/miro.c7
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c7
-rw-r--r--sound/isa/sb/sb16.c16
-rw-r--r--sound/isa/sb/sb8.c16
-rw-r--r--sound/isa/sgalaxy.c16
-rw-r--r--sound/isa/sscape.c16
-rw-r--r--sound/isa/wavefront/wavefront.c16
19 files changed, 129 insertions, 152 deletions
diff --git a/sound/isa/ad1848/ad1848.c b/sound/isa/ad1848/ad1848.c
index 326a057f752f..99908e44124d 100644
--- a/sound/isa/ad1848/ad1848.c
+++ b/sound/isa/ad1848/ad1848.c
@@ -193,9 +193,11 @@ static int __init alsa_card_ad1848_init(void)
193 continue; 193 continue;
194 device = platform_device_register_simple(SND_AD1848_DRIVER, 194 device = platform_device_register_simple(SND_AD1848_DRIVER,
195 i, NULL, 0); 195 i, NULL, 0);
196 if (IS_ERR(device)) { 196 if (IS_ERR(device))
197 err = PTR_ERR(device); 197 continue;
198 goto errout; 198 if (!platform_get_drvdata(device)) {
199 platform_device_unregister(device);
200 continue;
199 } 201 }
200 devices[i] = device; 202 devices[i] = device;
201 cards++; 203 cards++;
@@ -204,14 +206,10 @@ static int __init alsa_card_ad1848_init(void)
204#ifdef MODULE 206#ifdef MODULE
205 printk(KERN_ERR "AD1848 soundcard not found or device busy\n"); 207 printk(KERN_ERR "AD1848 soundcard not found or device busy\n");
206#endif 208#endif
207 err = -ENODEV; 209 snd_ad1848_unregister_all();
208 goto errout; 210 return -ENODEV;
209 } 211 }
210 return 0; 212 return 0;
211
212 errout:
213 snd_ad1848_unregister_all();
214 return err;
215} 213}
216 214
217static void __exit alsa_card_ad1848_exit(void) 215static void __exit alsa_card_ad1848_exit(void)
diff --git a/sound/isa/adlib.c b/sound/isa/adlib.c
index a253a14e6a45..1124344ed948 100644
--- a/sound/isa/adlib.c
+++ b/sound/isa/adlib.c
@@ -43,8 +43,7 @@ static int __devinit snd_adlib_probe(struct platform_device *device)
43 struct snd_card *card; 43 struct snd_card *card;
44 struct snd_opl3 *opl3; 44 struct snd_opl3 *opl3;
45 45
46 int error; 46 int error, i = device->id;
47 int i = device->id;
48 47
49 if (port[i] == SNDRV_AUTO_PORT) { 48 if (port[i] == SNDRV_AUTO_PORT) {
50 snd_printk(KERN_ERR DRV_NAME ": please specify port\n"); 49 snd_printk(KERN_ERR DRV_NAME ": please specify port\n");
@@ -95,8 +94,7 @@ static int __devinit snd_adlib_probe(struct platform_device *device)
95 return 0; 94 return 0;
96 95
97out1: snd_card_free(card); 96out1: snd_card_free(card);
98 out0: error = -EINVAL; /* FIXME: should be the original error code */ 97out0: return error;
99 return error;
100} 98}
101 99
102static int __devexit snd_adlib_remove(struct platform_device *device) 100static int __devexit snd_adlib_remove(struct platform_device *device)
@@ -134,6 +132,11 @@ static int __init alsa_card_adlib_init(void)
134 if (IS_ERR(device)) 132 if (IS_ERR(device))
135 continue; 133 continue;
136 134
135 if (!platform_get_drvdata(device)) {
136 platform_device_unregister(device);
137 continue;
138 }
139
137 devices[i] = device; 140 devices[i] = device;
138 cards++; 141 cards++;
139 } 142 }
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)
diff --git a/sound/isa/cs423x/cs4231.c b/sound/isa/cs423x/cs4231.c
index a30dcd962525..397310f358b7 100644
--- a/sound/isa/cs423x/cs4231.c
+++ b/sound/isa/cs423x/cs4231.c
@@ -209,9 +209,11 @@ static int __init alsa_card_cs4231_init(void)
209 continue; 209 continue;
210 device = platform_device_register_simple(SND_CS4231_DRIVER, 210 device = platform_device_register_simple(SND_CS4231_DRIVER,
211 i, NULL, 0); 211 i, NULL, 0);
212 if (IS_ERR(device)) { 212 if (IS_ERR(device))
213 err = PTR_ERR(device); 213 continue;
214 goto errout; 214 if (!platform_get_drvdata(device)) {
215 platform_device_unregister(device);
216 continue;
215 } 217 }
216 devices[i] = device; 218 devices[i] = device;
217 cards++; 219 cards++;
@@ -220,14 +222,10 @@ static int __init alsa_card_cs4231_init(void)
220#ifdef MODULE 222#ifdef MODULE
221 printk(KERN_ERR "CS4231 soundcard not found or device busy\n"); 223 printk(KERN_ERR "CS4231 soundcard not found or device busy\n");
222#endif 224#endif
223 err = -ENODEV; 225 snd_cs4231_unregister_all();
224 goto errout; 226 return -ENODEV;
225 } 227 }
226 return 0; 228 return 0;
227
228 errout:
229 snd_cs4231_unregister_all();
230 return err;
231} 229}
232 230
233static void __exit alsa_card_cs4231_exit(void) 231static void __exit alsa_card_cs4231_exit(void)
diff --git a/sound/isa/cs423x/cs4236.c b/sound/isa/cs423x/cs4236.c
index 382bb17ef49f..f7fa779347ff 100644
--- a/sound/isa/cs423x/cs4236.c
+++ b/sound/isa/cs423x/cs4236.c
@@ -780,9 +780,11 @@ static int __init alsa_card_cs423x_init(void)
780 continue; 780 continue;
781 device = platform_device_register_simple(CS423X_DRIVER, 781 device = platform_device_register_simple(CS423X_DRIVER,
782 i, NULL, 0); 782 i, NULL, 0);
783 if (IS_ERR(device)) { 783 if (IS_ERR(device))
784 err = PTR_ERR(device); 784 continue;
785 goto errout; 785 if (!platform_get_drvdata(device)) {
786 platform_device_unregister(device);
787 continue;
786 } 788 }
787 platform_devices[i] = device; 789 platform_devices[i] = device;
788 snd_cs423x_devices++; 790 snd_cs423x_devices++;
@@ -802,14 +804,10 @@ static int __init alsa_card_cs423x_init(void)
802#ifdef MODULE 804#ifdef MODULE
803 printk(KERN_ERR IDENT " soundcard not found or device busy\n"); 805 printk(KERN_ERR IDENT " soundcard not found or device busy\n");
804#endif 806#endif
805 err = -ENODEV; 807 snd_cs423x_unregister_all();
806 goto errout; 808 return -ENODEV;
807 } 809 }
808 return 0; 810 return 0;
809
810 errout:
811 snd_cs423x_unregister_all();
812 return err;
813} 811}
814 812
815static void __exit alsa_card_cs423x_exit(void) 813static void __exit alsa_card_cs423x_exit(void)
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 2b69fc829265..e90689ee162f 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -213,9 +213,11 @@ static int __init alsa_card_es1688_init(void)
213 continue; 213 continue;
214 device = platform_device_register_simple(ES1688_DRIVER, 214 device = platform_device_register_simple(ES1688_DRIVER,
215 i, NULL, 0); 215 i, NULL, 0);
216 if (IS_ERR(device)) { 216 if (IS_ERR(device))
217 err = PTR_ERR(device); 217 continue;
218 goto errout; 218 if (!platform_get_drvdata(device)) {
219 platform_device_unregister(device);
220 continue;
219 } 221 }
220 devices[i] = device; 222 devices[i] = device;
221 cards++; 223 cards++;
@@ -224,14 +226,10 @@ static int __init alsa_card_es1688_init(void)
224#ifdef MODULE 226#ifdef MODULE
225 printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n"); 227 printk(KERN_ERR "ESS AudioDrive ES1688 soundcard not found or device busy\n");
226#endif 228#endif
227 err = -ENODEV; 229 snd_es1688_unregister_all();
228 goto errout; 230 return -ENODEV;
229 } 231 }
230 return 0; 232 return 0;
231
232 errout:
233 snd_es1688_unregister_all();
234 return err;
235} 233}
236 234
237static void __exit alsa_card_es1688_exit(void) 235static void __exit alsa_card_es1688_exit(void)
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c
index 9fbc185b4cc2..a36ec1daa5cb 100644
--- a/sound/isa/es18xx.c
+++ b/sound/isa/es18xx.c
@@ -2391,9 +2391,11 @@ static int __init alsa_card_es18xx_init(void)
2391 continue; 2391 continue;
2392 device = platform_device_register_simple(ES18XX_DRIVER, 2392 device = platform_device_register_simple(ES18XX_DRIVER,
2393 i, NULL, 0); 2393 i, NULL, 0);
2394 if (IS_ERR(device)) { 2394 if (IS_ERR(device))
2395 err = PTR_ERR(device); 2395 continue;
2396 goto errout; 2396 if (!platform_get_drvdata(device)) {
2397 platform_device_unregister(device);
2398 continue;
2397 } 2399 }
2398 platform_devices[i] = device; 2400 platform_devices[i] = device;
2399 cards++; 2401 cards++;
@@ -2411,14 +2413,10 @@ static int __init alsa_card_es18xx_init(void)
2411#ifdef MODULE 2413#ifdef MODULE
2412 snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n"); 2414 snd_printk(KERN_ERR "ESS AudioDrive ES18xx soundcard not found or device busy\n");
2413#endif 2415#endif
2414 err = -ENODEV; 2416 snd_es18xx_unregister_all();
2415 goto errout; 2417 return -ENODEV;
2416 } 2418 }
2417 return 0; 2419 return 0;
2418
2419 errout:
2420 snd_es18xx_unregister_all();
2421 return err;
2422} 2420}
2423 2421
2424static void __exit alsa_card_es18xx_exit(void) 2422static void __exit alsa_card_es18xx_exit(void)
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 26dccfea2437..37057a37dc30 100644
--- a/sound/isa/gus/gusclassic.c
+++ b/sound/isa/gus/gusclassic.c
@@ -253,9 +253,11 @@ static int __init alsa_card_gusclassic_init(void)
253 continue; 253 continue;
254 device = platform_device_register_simple(GUSCLASSIC_DRIVER, 254 device = platform_device_register_simple(GUSCLASSIC_DRIVER,
255 i, NULL, 0); 255 i, NULL, 0);
256 if (IS_ERR(device)) { 256 if (IS_ERR(device))
257 err = PTR_ERR(device); 257 continue;
258 goto errout; 258 if (!platform_get_drvdata(device)) {
259 platform_device_unregister(device);
260 continue;
259 } 261 }
260 devices[i] = device; 262 devices[i] = device;
261 cards++; 263 cards++;
@@ -264,14 +266,10 @@ static int __init alsa_card_gusclassic_init(void)
264#ifdef MODULE 266#ifdef MODULE
265 printk(KERN_ERR "GUS Classic soundcard not found or device busy\n"); 267 printk(KERN_ERR "GUS Classic soundcard not found or device busy\n");
266#endif 268#endif
267 err = -ENODEV; 269 snd_gusclassic_unregister_all();
268 goto errout; 270 return -ENODEV;
269 } 271 }
270 return 0; 272 return 0;
271
272 errout:
273 snd_gusclassic_unregister_all();
274 return err;
275} 273}
276 274
277static void __exit alsa_card_gusclassic_exit(void) 275static void __exit alsa_card_gusclassic_exit(void)
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c
index 31dc20501d0c..05852fcc613b 100644
--- a/sound/isa/gus/gusextreme.c
+++ b/sound/isa/gus/gusextreme.c
@@ -363,9 +363,11 @@ static int __init alsa_card_gusextreme_init(void)
363 continue; 363 continue;
364 device = platform_device_register_simple(GUSEXTREME_DRIVER, 364 device = platform_device_register_simple(GUSEXTREME_DRIVER,
365 i, NULL, 0); 365 i, NULL, 0);
366 if (IS_ERR(device)) { 366 if (IS_ERR(device))
367 err = PTR_ERR(device); 367 continue;
368 goto errout; 368 if (!platform_get_drvdata(device)) {
369 platform_device_unregister(device);
370 continue;
369 } 371 }
370 devices[i] = device; 372 devices[i] = device;
371 cards++; 373 cards++;
@@ -374,14 +376,10 @@ static int __init alsa_card_gusextreme_init(void)
374#ifdef MODULE 376#ifdef MODULE
375 printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n"); 377 printk(KERN_ERR "GUS Extreme soundcard not found or device busy\n");
376#endif 378#endif
377 err = -ENODEV; 379 snd_gusextreme_unregister_all();
378 goto errout; 380 return -ENODEV;
379 } 381 }
380 return 0; 382 return 0;
381
382 errout:
383 snd_gusextreme_unregister_all();
384 return err;
385} 383}
386 384
387static void __exit alsa_card_gusextreme_exit(void) 385static void __exit alsa_card_gusextreme_exit(void)
diff --git a/sound/isa/gus/gusmax.c b/sound/isa/gus/gusmax.c
index cafb9b67fa72..fcf2c8fe6f94 100644
--- a/sound/isa/gus/gusmax.c
+++ b/sound/isa/gus/gusmax.c
@@ -390,9 +390,11 @@ static int __init alsa_card_gusmax_init(void)
390 continue; 390 continue;
391 device = platform_device_register_simple(GUSMAX_DRIVER, 391 device = platform_device_register_simple(GUSMAX_DRIVER,
392 i, NULL, 0); 392 i, NULL, 0);
393 if (IS_ERR(device)) { 393 if (IS_ERR(device))
394 err = PTR_ERR(device); 394 continue;
395 goto errout; 395 if (!platform_get_drvdata(device)) {
396 platform_device_unregister(device);
397 continue;
396 } 398 }
397 devices[i] = device; 399 devices[i] = device;
398 cards++; 400 cards++;
@@ -401,14 +403,10 @@ static int __init alsa_card_gusmax_init(void)
401#ifdef MODULE 403#ifdef MODULE
402 printk(KERN_ERR "GUS MAX soundcard not found or device busy\n"); 404 printk(KERN_ERR "GUS MAX soundcard not found or device busy\n");
403#endif 405#endif
404 err = -ENODEV; 406 snd_gusmax_unregister_all();
405 goto errout; 407 return -ENODEV;
406 } 408 }
407 return 0; 409 return 0;
408
409 errout:
410 snd_gusmax_unregister_all();
411 return err;
412} 410}
413 411
414static void __exit alsa_card_gusmax_exit(void) 412static void __exit alsa_card_gusmax_exit(void)
diff --git a/sound/isa/gus/interwave.c b/sound/isa/gus/interwave.c
index de71b7a99c83..4298d339e786 100644
--- a/sound/isa/gus/interwave.c
+++ b/sound/isa/gus/interwave.c
@@ -947,9 +947,11 @@ static int __init alsa_card_interwave_init(void)
947#endif 947#endif
948 device = platform_device_register_simple(INTERWAVE_DRIVER, 948 device = platform_device_register_simple(INTERWAVE_DRIVER,
949 i, NULL, 0); 949 i, NULL, 0);
950 if (IS_ERR(device)) { 950 if (IS_ERR(device))
951 err = PTR_ERR(device); 951 continue;
952 goto errout; 952 if (!platform_get_drvdata(device)) {
953 platform_device_unregister(device);
954 continue;
953 } 955 }
954 platform_devices[i] = device; 956 platform_devices[i] = device;
955 cards++; 957 cards++;
@@ -966,14 +968,10 @@ static int __init alsa_card_interwave_init(void)
966#ifdef MODULE 968#ifdef MODULE
967 printk(KERN_ERR "InterWave soundcard not found or device busy\n"); 969 printk(KERN_ERR "InterWave soundcard not found or device busy\n");
968#endif 970#endif
969 err = -ENODEV; 971 snd_interwave_unregister_all();
970 goto errout; 972 return -ENODEV;
971 } 973 }
972 return 0; 974 return 0;
973
974 errout:
975 snd_interwave_unregister_all();
976 return err;
977} 975}
978 976
979static void __exit alsa_card_interwave_exit(void) 977static void __exit alsa_card_interwave_exit(void)
diff --git a/sound/isa/opl3sa2.c b/sound/isa/opl3sa2.c
index c906e205d7d5..6d889052c32c 100644
--- a/sound/isa/opl3sa2.c
+++ b/sound/isa/opl3sa2.c
@@ -962,9 +962,11 @@ static int __init alsa_card_opl3sa2_init(void)
962#endif 962#endif
963 device = platform_device_register_simple(OPL3SA2_DRIVER, 963 device = platform_device_register_simple(OPL3SA2_DRIVER,
964 i, NULL, 0); 964 i, NULL, 0);
965 if (IS_ERR(device)) { 965 if (IS_ERR(device))
966 err = PTR_ERR(device); 966 continue;
967 goto errout; 967 if (!platform_get_drvdata(device)) {
968 platform_device_unregister(device);
969 continue;
968 } 970 }
969 platform_devices[i] = device; 971 platform_devices[i] = device;
970 snd_opl3sa2_devices++; 972 snd_opl3sa2_devices++;
@@ -983,14 +985,10 @@ static int __init alsa_card_opl3sa2_init(void)
983#ifdef MODULE 985#ifdef MODULE
984 snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n"); 986 snd_printk(KERN_ERR "Yamaha OPL3-SA soundcard not found or device busy\n");
985#endif 987#endif
986 err = -ENODEV; 988 snd_opl3sa2_unregister_all();
987 goto errout; 989 return -ENODEV;
988 } 990 }
989 return 0; 991 return 0;
990
991 errout:
992 snd_opl3sa2_unregister_all();
993 return err;
994} 992}
995 993
996static void __exit alsa_card_opl3sa2_exit(void) 994static void __exit alsa_card_opl3sa2_exit(void)
diff --git a/sound/isa/opti9xx/miro.c b/sound/isa/opti9xx/miro.c
index 09384d03dc31..83d64bc07ff0 100644
--- a/sound/isa/opti9xx/miro.c
+++ b/sound/isa/opti9xx/miro.c
@@ -1436,8 +1436,11 @@ static int __init alsa_card_miro_init(void)
1436 if ((error = platform_driver_register(&snd_miro_driver)) < 0) 1436 if ((error = platform_driver_register(&snd_miro_driver)) < 0)
1437 return error; 1437 return error;
1438 device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); 1438 device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
1439 if (! IS_ERR(device)) 1439 if (! IS_ERR(device)) {
1440 return 0; 1440 if (platform_get_drvdata(device))
1441 return 0;
1442 platform_device_unregister(device);
1443 }
1441#ifdef MODULE 1444#ifdef MODULE
1442 printk(KERN_ERR "no miro soundcard found\n"); 1445 printk(KERN_ERR "no miro soundcard found\n");
1443#endif 1446#endif
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 65b28cbc0ebd..8ee0d70536f9 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -2099,8 +2099,11 @@ static int __init alsa_card_opti9xx_init(void)
2099 return error; 2099 return error;
2100 device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); 2100 device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
2101 if (!IS_ERR(device)) { 2101 if (!IS_ERR(device)) {
2102 snd_opti9xx_platform_device = device; 2102 if (platform_get_drvdata(device)) {
2103 return 0; 2103 snd_opti9xx_platform_device = device;
2104 return 0;
2105 }
2106 platform_device_unregister(device);
2104 } 2107 }
2105 platform_driver_unregister(&snd_opti9xx_driver); 2108 platform_driver_unregister(&snd_opti9xx_driver);
2106 } 2109 }
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
758static void __exit alsa_card_sb16_exit(void) 756static void __exit alsa_card_sb16_exit(void)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index 3efa23d303c3..141400c01426 100644
--- a/sound/isa/sb/sb8.c
+++ b/sound/isa/sb/sb8.c
@@ -264,9 +264,11 @@ static int __init alsa_card_sb8_init(void)
264 continue; 264 continue;
265 device = platform_device_register_simple(SND_SB8_DRIVER, 265 device = platform_device_register_simple(SND_SB8_DRIVER,
266 i, NULL, 0); 266 i, NULL, 0);
267 if (IS_ERR(device)) { 267 if (IS_ERR(device))
268 err = PTR_ERR(device); 268 continue;
269 goto errout; 269 if (!platform_get_drvdata(device)) {
270 platform_device_unregister(device);
271 continue;
270 } 272 }
271 devices[i] = device; 273 devices[i] = device;
272 cards++; 274 cards++;
@@ -275,14 +277,10 @@ static int __init alsa_card_sb8_init(void)
275#ifdef MODULE 277#ifdef MODULE
276 snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n"); 278 snd_printk(KERN_ERR "Sound Blaster soundcard not found or device busy\n");
277#endif 279#endif
278 err = -ENODEV; 280 snd_sb8_unregister_all();
279 goto errout; 281 return -ENODEV;
280 } 282 }
281 return 0; 283 return 0;
282
283 errout:
284 snd_sb8_unregister_all();
285 return err;
286} 284}
287 285
288static void __exit alsa_card_sb8_exit(void) 286static void __exit alsa_card_sb8_exit(void)
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
390static void __exit alsa_card_sgalaxy_exit(void) 388static void __exit alsa_card_sgalaxy_exit(void)
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 48e5552d3444..d2a856f0fde2 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -1427,8 +1427,8 @@ static int __init sscape_manual_probe(void)
1427 dma[i] == SNDRV_AUTO_DMA) { 1427 dma[i] == SNDRV_AUTO_DMA) {
1428 printk(KERN_INFO 1428 printk(KERN_INFO
1429 "sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n"); 1429 "sscape: insufficient parameters, need IO, IRQ, MPU-IRQ and DMA\n");
1430 ret = -ENXIO; 1430 sscape_unregister_all();
1431 goto errout; 1431 return -ENXIO;
1432 } 1432 }
1433 1433
1434 /* 1434 /*
@@ -1436,17 +1436,15 @@ static int __init sscape_manual_probe(void)
1436 */ 1436 */
1437 device = platform_device_register_simple(SSCAPE_DRIVER, 1437 device = platform_device_register_simple(SSCAPE_DRIVER,
1438 i, NULL, 0); 1438 i, NULL, 0);
1439 if (IS_ERR(device)) { 1439 if (IS_ERR(device))
1440 ret = PTR_ERR(device); 1440 continue;
1441 goto errout; 1441 if (!platform_get_drvdata(device)) {
1442 platform_device_unregister(device);
1443 continue;
1442 } 1444 }
1443 platform_devices[i] = device; 1445 platform_devices[i] = device;
1444 } 1446 }
1445 return 0; 1447 return 0;
1446
1447 errout:
1448 sscape_unregister_all();
1449 return ret;
1450} 1448}
1451 1449
1452static void sscape_exit(void) 1450static void sscape_exit(void)
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
755static void __exit alsa_card_wavefront_exit(void) 753static void __exit alsa_card_wavefront_exit(void)