aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/cs423x
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/cs423x
parentc63e31c2cc1ec67372920b5e1aff8204d04dd172 (diff)
parentf4ffaa452e71495a06376f12f772342bc57051fc (diff)
Merge branch 'master'
Diffstat (limited to 'sound/isa/cs423x')
-rw-r--r--sound/isa/cs423x/cs4231.c16
-rw-r--r--sound/isa/cs423x/cs4236.c16
2 files changed, 14 insertions, 18 deletions
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)