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."); module_param_array(pcm_channels, int, NULL, 0444); MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Extreme driver."); +struct platform_device *devices[SNDRV_CARDS]; + #define PFX "gusextreme: " @@ -337,6 +339,15 @@ static struct platform_driver snd_gusextreme_driver = { }, }; +static void __init_or_module snd_gusextreme_unregister_all(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(devices); ++i) + platform_device_unregister(devices[i]); + platform_driver_unregister(&snd_gusextreme_driver); +} + static int __init alsa_card_gusextreme_init(void) { int i, cards, err; @@ -354,6 +365,7 @@ static int __init alsa_card_gusextreme_init(void) err = PTR_ERR(device); goto errout; } + devices[i] = device; cards++; } if (!cards) { @@ -366,13 +378,13 @@ static int __init alsa_card_gusextreme_init(void) return 0; errout: - platform_driver_unregister(&snd_gusextreme_driver); + snd_gusextreme_unregister_all(); return err; } static void __exit alsa_card_gusextreme_exit(void) { - platform_driver_unregister(&snd_gusextreme_driver); + snd_gusextreme_unregister_all(); } module_init(alsa_card_gusextreme_init) |