diff options
Diffstat (limited to 'sound/isa/gus/gusclassic.c')
-rw-r--r-- | sound/isa/gus/gusclassic.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c index 57beb74f5b9d..d1165b96fa3f 100644 --- a/sound/isa/gus/gusclassic.c +++ b/sound/isa/gus/gusclassic.c | |||
@@ -71,6 +71,8 @@ MODULE_PARM_DESC(channels, "GF1 channels for GUS Classic driver."); | |||
71 | module_param_array(pcm_channels, int, NULL, 0444); | 71 | module_param_array(pcm_channels, int, NULL, 0444); |
72 | MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver."); | 72 | MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver."); |
73 | 73 | ||
74 | static struct platform_device *devices[SNDRV_CARDS]; | ||
75 | |||
74 | 76 | ||
75 | #define PFX "gusclassic: " | 77 | #define PFX "gusclassic: " |
76 | 78 | ||
@@ -227,6 +229,15 @@ static struct platform_driver snd_gusclassic_driver = { | |||
227 | }, | 229 | }, |
228 | }; | 230 | }; |
229 | 231 | ||
232 | static void __init_or_module snd_gusclassic_unregister_all(void) | ||
233 | { | ||
234 | int i; | ||
235 | |||
236 | for (i = 0; i < ARRAY_SIZE(devices); ++i) | ||
237 | platform_device_unregister(devices[i]); | ||
238 | platform_driver_unregister(&snd_gusclassic_driver); | ||
239 | } | ||
240 | |||
230 | static int __init alsa_card_gusclassic_init(void) | 241 | static int __init alsa_card_gusclassic_init(void) |
231 | { | 242 | { |
232 | int i, cards, err; | 243 | int i, cards, err; |
@@ -244,6 +255,7 @@ static int __init alsa_card_gusclassic_init(void) | |||
244 | err = PTR_ERR(device); | 255 | err = PTR_ERR(device); |
245 | goto errout; | 256 | goto errout; |
246 | } | 257 | } |
258 | devices[i] = device; | ||
247 | cards++; | 259 | cards++; |
248 | } | 260 | } |
249 | if (!cards) { | 261 | if (!cards) { |
@@ -256,13 +268,13 @@ static int __init alsa_card_gusclassic_init(void) | |||
256 | return 0; | 268 | return 0; |
257 | 269 | ||
258 | errout: | 270 | errout: |
259 | platform_driver_unregister(&snd_gusclassic_driver); | 271 | snd_gusclassic_unregister_all(); |
260 | return err; | 272 | return err; |
261 | } | 273 | } |
262 | 274 | ||
263 | static void __exit alsa_card_gusclassic_exit(void) | 275 | static void __exit alsa_card_gusclassic_exit(void) |
264 | { | 276 | { |
265 | platform_driver_unregister(&snd_gusclassic_driver); | 277 | snd_gusclassic_unregister_all(); |
266 | } | 278 | } |
267 | 279 | ||
268 | module_init(alsa_card_gusclassic_init) | 280 | module_init(alsa_card_gusclassic_init) |