aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx
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/opti9xx
parent416c1079d30f1a52399b96f6772e993274b774ae (diff)
downloadkernel_samsung_smdk4412-f7a9275d949cb0bf1f259a1546e52a0bf518151c.zip
kernel_samsung_smdk4412-f7a9275d949cb0bf1f259a1546e52a0bf518151c.tar.gz
kernel_samsung_smdk4412-f7a9275d949cb0bf1f259a1546e52a0bf518151c.tar.bz2
[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/opti9xx')
-rw-r--r--sound/isa/opti9xx/opti92x-ad1848.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/isa/opti9xx/opti92x-ad1848.c b/sound/isa/opti9xx/opti92x-ad1848.c
index 39211e5..1ea3944 100644
--- a/sound/isa/opti9xx/opti92x-ad1848.c
+++ b/sound/isa/opti9xx/opti92x-ad1848.c
@@ -259,6 +259,7 @@ struct snd_opti9xx {
};
static int snd_opti9xx_pnp_is_probed;
+static struct platform_device *snd_opti9xx_platform_device;
#ifdef CONFIG_PNP
@@ -2095,8 +2096,10 @@ static int __init alsa_card_opti9xx_init(void)
if (error < 0)
return error;
device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0);
- if (! IS_ERR(device))
+ if (!IS_ERR(device)) {
+ snd_opti9xx_platform_device = device;
return 0;
+ }
platform_driver_unregister(&snd_opti9xx_driver);
}
pnp_unregister_card_driver(&opti9xx_pnpc_driver);
@@ -2108,8 +2111,10 @@ static int __init alsa_card_opti9xx_init(void)
static void __exit alsa_card_opti9xx_exit(void)
{
- if (! snd_opti9xx_pnp_is_probed)
+ if (!snd_opti9xx_pnp_is_probed) {
+ platform_device_unregister(snd_opti9xx_platform_device);
platform_driver_unregister(&snd_opti9xx_driver);
+ }
pnp_unregister_card_driver(&opti9xx_pnpc_driver);
}