summaryrefslogtreecommitdiffstats
path: root/sound/isa/opti9xx/opti92x-ad1848.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/isa/opti9xx/opti92x-ad1848.c')
-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 39211e58cd68..1ea3944ef7ab 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);
}