提交 a182ee98 编写于 作者: R Rene Herman 提交者: Jaroslav Kysela

[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: NRene Herman <rene.herman@keyaccess.nl>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 5c59e09d
...@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(void) ...@@ -675,10 +675,8 @@ static int __init alsa_card_dummy_init(void)
continue; continue;
device = platform_device_register_simple(SND_DUMMY_DRIVER, device = platform_device_register_simple(SND_DUMMY_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(void) ...@@ -686,14 +684,10 @@ static int __init alsa_card_dummy_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Dummy soundcard not found or device busy\n"); printk(KERN_ERR "Dummy soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_dummy_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_dummy_unregister_all();
return err;
} }
static void __exit alsa_card_dummy_exit(void) static void __exit alsa_card_dummy_exit(void)
......
...@@ -251,10 +251,8 @@ static int __init alsa_card_mpu401_init(void) ...@@ -251,10 +251,8 @@ static int __init alsa_card_mpu401_init(void)
#endif #endif
device = platform_device_register_simple(SND_MPU401_DRIVER, device = platform_device_register_simple(SND_MPU401_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
platform_devices[i] = device; platform_devices[i] = device;
snd_mpu401_devices++; snd_mpu401_devices++;
} }
...@@ -266,14 +264,10 @@ static int __init alsa_card_mpu401_init(void) ...@@ -266,14 +264,10 @@ static int __init alsa_card_mpu401_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "MPU-401 device not found or device busy\n"); printk(KERN_ERR "MPU-401 device not found or device busy\n");
#endif #endif
err = -ENODEV; snd_mpu401_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_mpu401_unregister_all();
return err;
} }
static void __exit alsa_card_mpu401_exit(void) static void __exit alsa_card_mpu401_exit(void)
......
...@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(void) ...@@ -996,10 +996,8 @@ static int __init alsa_card_serial_init(void)
continue; continue;
device = platform_device_register_simple(SND_SERIAL_DRIVER, device = platform_device_register_simple(SND_SERIAL_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(void) ...@@ -1007,14 +1005,10 @@ static int __init alsa_card_serial_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "serial midi soundcard not found or device busy\n"); printk(KERN_ERR "serial midi soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_serial_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_serial_unregister_all();
return err;
} }
static void __exit alsa_card_serial_exit(void) static void __exit alsa_card_serial_exit(void)
......
...@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void) ...@@ -169,10 +169,8 @@ static int __init alsa_card_virmidi_init(void)
continue; continue;
device = platform_device_register_simple(SND_VIRMIDI_DRIVER, device = platform_device_register_simple(SND_VIRMIDI_DRIVER,
i, NULL, 0); i, NULL, 0);
if (IS_ERR(device)) { if (IS_ERR(device))
err = PTR_ERR(device); continue;
goto errout;
}
devices[i] = device; devices[i] = device;
cards++; cards++;
} }
...@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void) ...@@ -180,14 +178,10 @@ static int __init alsa_card_virmidi_init(void)
#ifdef MODULE #ifdef MODULE
printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n"); printk(KERN_ERR "Card-VirMIDI soundcard not found or device busy\n");
#endif #endif
err = -ENODEV; snd_virmidi_unregister_all();
goto errout; return -ENODEV;
} }
return 0; return 0;
errout:
snd_virmidi_unregister_all();
return err;
} }
static void __exit alsa_card_virmidi_exit(void) static void __exit alsa_card_virmidi_exit(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册