aboutsummaryrefslogtreecommitdiff
path: root/sound/isa/gus/gusclassic.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-12-07 09:13:42 +0100
committerJaroslav Kysela <perex@suse.cz>2006-01-03 12:30:39 +0100
commitf7a9275d949cb0bf1f259a1546e52a0bf518151c (patch)
tree4d96d9b6196d43684903857ba676dc51bbde4026 /sound/isa/gus/gusclassic.c
parent416c1079d30f1a52399b96f6772e993274b774ae (diff)
[ALSA] unregister platform devices
Call platform_device_unregister() for all platform devices that we've registered. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Diffstat (limited to 'sound/isa/gus/gusclassic.c')
-rw-r--r--sound/isa/gus/gusclassic.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/isa/gus/gusclassic.c b/sound/isa/gus/gusclassic.c
index 57beb74f5b9..d1165b96fa3 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.");
module_param_array(pcm_channels, int, NULL, 0444);
MODULE_PARM_DESC(pcm_channels, "Reserved PCM channels for GUS Classic driver.");
+static struct platform_device *devices[SNDRV_CARDS];
+
#define PFX "gusclassic: "
@@ -227,6 +229,15 @@ static struct platform_driver snd_gusclassic_driver = {
},
};
+static void __init_or_module snd_gusclassic_unregister_all(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(devices); ++i)
+ platform_device_unregister(devices[i]);
+ platform_driver_unregister(&snd_gusclassic_driver);
+}
+
static int __init alsa_card_gusclassic_init(void)
{
int i, cards, err;
@@ -244,6 +255,7 @@ static int __init alsa_card_gusclassic_init(void)
err = PTR_ERR(device);
goto errout;
}
+ devices[i] = device;
cards++;
}
if (!cards) {
@@ -256,13 +268,13 @@ static int __init alsa_card_gusclassic_init(void)
return 0;
errout:
- platform_driver_unregister(&snd_gusclassic_driver);
+ snd_gusclassic_unregister_all();
return err;
}
static void __exit alsa_card_gusclassic_exit(void)
{
- platform_driver_unregister(&snd_gusclassic_driver);
+ snd_gusclassic_unregister_all();
}
module_init(alsa_card_gusclassic_init)