diff options
Diffstat (limited to 'sound/isa/es18xx.c')
-rw-r--r-- | sound/isa/es18xx.c | 16 |
1 files changed, 7 insertions, 9 deletions
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 | ||
2424 | static void __exit alsa_card_es18xx_exit(void) | 2422 | static void __exit alsa_card_es18xx_exit(void) |