diff options
Diffstat (limited to 'sound/isa/gus/gusmax.c')
| -rw-r--r-- | sound/isa/gus/gusmax.c | 16 |
1 files changed, 7 insertions, 9 deletions
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 | ||
| 414 | static void __exit alsa_card_gusmax_exit(void) | 412 | static void __exit alsa_card_gusmax_exit(void) |
