diff options
Diffstat (limited to 'sound/isa/gus/gusextreme.c')
-rw-r--r-- | sound/isa/gus/gusextreme.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/isa/gus/gusextreme.c b/sound/isa/gus/gusextreme.c index 6fad9734a853..239f16e6b9ee 100644 --- a/sound/isa/gus/gusextreme.c +++ b/sound/isa/gus/gusextreme.c | |||
@@ -87,6 +87,8 @@ MODULE_PARM_DESC(channels, "GF1 channels for GUS Extreme driver."); | |||
87 | module_param_array(pcm_channels, int, NULL, 0444); | 87 | module_param_array(pcm_channels, int, NULL, 0444); |
88 | MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver."); | 88 | MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver."); |
89 | 89 | ||
90 | struct platform_device *devices[SNDRV_CARDS]; | ||
91 | |||
90 | 92 | ||
91 | #define PFX "gusextreme: " | 93 | #define PFX "gusextreme: " |
92 | 94 | ||
@@ -337,6 +339,15 @@ static struct platform_driver snd_gusextreme_driver = { | |||
337 | }, | 339 | }, |
338 | }; | 340 | }; |
339 | 341 | ||
342 | static void __init_or_module snd_gusextreme_unregister_all(void) | ||
343 | { | ||
344 | int i; | ||
345 | |||
346 | for (i = 0; i < ARRAY_SIZE(devices); ++i) | ||
347 | platform_device_unregister(devices[i]); | ||
348 | platform_driver_unregister(&snd_gusextreme_driver); | ||
349 | } | ||
350 | |||
340 | static int __init alsa_card_gusextreme_init(void) | 351 | static int __init alsa_card_gusextreme_init(void) |
341 | { | 352 | { |
342 | int i, cards, err; | 353 | int i, cards, err; |
@@ -354,6 +365,7 @@ static int __init alsa_card_gusextreme_init(void) | |||
354 | err = PTR_ERR(device); | 365 | err = PTR_ERR(device); |
355 | goto errout; | 366 | goto errout; |
356 | } | 367 | } |
368 | devices[i] = device; | ||
357 | cards++; | 369 | cards++; |
358 | } | 370 | } |
359 | if (!cards) { | 371 | if (!cards) { |
@@ -366,13 +378,13 @@ static int __init alsa_card_gusextreme_init(void) | |||
366 | return 0; | 378 | return 0; |
367 | 379 | ||
368 | errout: | 380 | errout: |
369 | platform_driver_unregister(&snd_gusextreme_driver); | 381 | snd_gusextreme_unregister_all(); |
370 | return err; | 382 | return err; |
371 | } | 383 | } |
372 | 384 | ||
373 | static void __exit alsa_card_gusextreme_exit(void) | 385 | static void __exit alsa_card_gusextreme_exit(void) |
374 | { | 386 | { |
375 | platform_driver_unregister(&snd_gusextreme_driver); | 387 | snd_gusextreme_unregister_all(); |
376 | } | 388 | } |
377 | 389 | ||
378 | module_init(alsa_card_gusextreme_init) | 390 | module_init(alsa_card_gusextreme_init) |