diff options
author | Rene Herman <rene.herman@keyaccess.nl> | 2006-04-13 06:57:11 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-04-27 15:10:08 -0400 |
commit | a182ee9876c7826d0b8f7789cb5c38c5bfbec441 (patch) | |
tree | 68862b25d3e70a8c294ec248d3473e30fb2aae94 | |
parent | 5c59e09d7e51f5781439aa6f1963076568fd1f4f (diff) |
[ALSA] continue on IS_ERR from platform device registration
I previously only concerned myself with sound/isa. When I now checked
for more platform_device_register_simple() usages in ALSA I found a
couple more drivers that needed the same patches as already submitted
for all the ISA drivers.
This first one is the continue-on-iserr patch for sound/drivers. This
gets them all.
Signed-off-by: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/drivers/dummy.c | 14 | ||||
-rw-r--r-- | sound/drivers/mpu401/mpu401.c | 14 | ||||
-rw-r--r-- | sound/drivers/serial-u16550.c | 14 | ||||
-rw-r--r-- | sound/drivers/virmidi.c | 14 |
4 files changed, 16 insertions, 40 deletions
diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c index e35fd5779a9d..ae0df549fac7 100644 --- a/sound/drivers/dummy.c +++ b/sound/drivers/dummy.c | |||
@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(void) | |||
675 | continue; | 675 | continue; |
676 | device = platform_device_register_simple(SND_DUMMY_DRIVER, | 676 | device = platform_device_register_simple(SND_DUMMY_DRIVER, |
677 | i, NULL, 0); | 677 | i, NULL, 0); |
678 | if (IS_ERR(device)) { | 678 | if (IS_ERR(device)) |
679 | err = PTR_ERR(device); | 679 | continue; |
680 | goto errout; | ||
681 | } | ||
682 | devices[i] = device; | 680 | devices[i] = device; |
683 | cards++; | 681 | cards++; |
684 | } | 682 | } |
@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(void) | |||
686 | #ifdef MODULE | 684 | #ifdef MODULE |
687 | printk(KERN_ERR "Dummy soundcard not found or device busy\n"); | 685 | printk(KERN_ERR "Dummy soundcard not found or device busy\n"); |
688 | #endif | 686 | #endif |
689 | err = -ENODEV; | 687 | snd_dummy_unregister_all(); |
690 | goto errout; | 688 | return -ENODEV; |
691 | } | 689 | } |
692 | return 0; | 690 | return 0; |
693 | |||
694 | errout: | ||
695 | snd_dummy_unregister_all(); | ||
696 | return err; | ||
697 | } | 691 | } |
698 | 692 | ||
699 | static void __exit alsa_card_dummy_exit(void) | 693 | static void __exit alsa_card_dummy_exit(void) |
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index 9ea3059a7064..da7ef26995c3 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -251,10 +251,8 @@ static int __init alsa_card_mpu401_init(void) | |||
251 | #endif | 251 | #endif |
252 | device = platform_device_register_simple(SND_MPU401_DRIVER, | 252 | device = platform_device_register_simple(SND_MPU401_DRIVER, |
253 | i, NULL, 0); | 253 | i, NULL, 0); |
254 | if (IS_ERR(device)) { | 254 | if (IS_ERR(device)) |
255 | err = PTR_ERR(device); | 255 | continue; |
256 | goto errout; | ||
257 | } | ||
258 | platform_devices[i] = device; | 256 | platform_devices[i] = device; |
259 | snd_mpu401_devices++; | 257 | snd_mpu401_devices++; |
260 | } | 258 | } |
@@ -266,14 +264,10 @@ static int __init alsa_card_mpu401_init(void) | |||
266 | #ifdef MODULE | 264 | #ifdef MODULE |
267 | printk(KERN_ERR "MPU-401 device not found or device busy\n"); | 265 | printk(KERN_ERR "MPU-401 device not found or device busy\n"); |
268 | #endif | 266 | #endif |
269 | err = -ENODEV; | 267 | snd_mpu401_unregister_all(); |
270 | goto errout; | 268 | return -ENODEV; |
271 | } | 269 | } |
272 | return 0; | 270 | return 0; |
273 | |||
274 | errout: | ||
275 | snd_mpu401_unregister_all(); | ||
276 | return err; | ||
277 | } | 271 | } |
278 | 272 | ||
279 | static void __exit alsa_card_mpu401_exit(void) | 273 | static void __exit alsa_card_mpu401_exit(void) |
diff --git a/sound/drivers/serial-u16550.c b/sound/drivers/serial-u16550.c index 1a7fbefe4740..c01b4c5118b9 100644 --- a/sound/drivers/serial-u16550.c +++ b/sound/drivers/serial-u16550.c | |||
@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(void) | |||
996 | continue; | 996 | continue; |
997 | device = platform_device_register_simple(SND_SERIAL_DRIVER, | 997 | device = platform_device_register_simple(SND_SERIAL_DRIVER, |
998 | i, NULL, 0); | 998 | i, NULL, 0); |
999 | if (IS_ERR(device)) { | 999 | if (IS_ERR(device)) |
1000 | err = PTR_ERR(device); | 1000 | continue; |
1001 | goto errout; | ||
1002 | } | ||
1003 | devices[i] = device; | 1001 | devices[i] = device; |
1004 | cards++; | 1002 | cards++; |
1005 | } | 1003 | } |
@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(void) | |||
1007 | #ifdef MODULE | 1005 | #ifdef MODULE |
1008 | printk(KERN_ERR "serial midi soundcard not found or device busy\n"); | 1006 | printk(KERN_ERR "serial midi soundcard not found or device busy\n"); |
1009 | #endif | 1007 | #endif |
1010 | err = -ENODEV; | 1008 | snd_serial_unregister_all(); |
1011 | goto errout; | 1009 | return -ENODEV; |
1012 | } | 1010 | } |
1013 | return 0; | 1011 | return 0; |
1014 | |||
1015 | errout: | ||
1016 | snd_serial_unregister_all(); | ||
1017 | return err; | ||
1018 | } | 1012 | } |
1019 | 1013 | ||
1020 | static void __exit alsa_card_serial_exit(void) | 1014 | static void __exit alsa_card_serial_exit(void) |
diff --git a/sound/drivers/virmidi.c b/sound/drivers/virmidi.c index a3ee306239c9..26eb2499d442 100644 --- a/sound/drivers/virmidi.c +++ b/sound/drivers/virmidi.c | |||
@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void) | |||
169 | continue; | 169 | continue; |
170 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, | 170 | device = platform_device_register_simple(SND_VIRMIDI_DRIVER, |
171 | i, NULL, 0); | 171 | i, NULL, 0); |
172 | if (IS_ERR(device)) { | 172 | if (IS_ERR(device)) |
173 | err = PTR_ERR(device); | 173 | continue; |
174 | goto errout; | ||
175 | } | ||
176 | devices[i] = device; | 174 | devices[i] = device; |
177 | cards++; | 175 | cards++; |
178 | } | 176 | } |
@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void) | |||
180 | #ifdef MODULE | 178 | #ifdef MODULE |
181 | printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); | 179 | printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); |
182 | #endif | 180 | #endif |
183 | err = -ENODEV; | 181 | snd_virmidi_unregister_all(); |
184 | goto errout; | 182 | return -ENODEV; |
185 | } | 183 | } |
186 | return 0; | 184 | return 0; |
187 | |||
188 | errout: | ||
189 | snd_virmidi_unregister_all(); | ||
190 | return err; | ||
191 | } | 185 | } |
192 | 186 | ||
193 | static void __exit alsa_card_virmidi_exit(void) | 187 | static void __exit alsa_card_virmidi_exit(void) |