From f7a9275d949cb0bf1f259a1546e52a0bf518151c Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Wed, 7 Dec 2005 09:13:42 +0100 Subject: [ALSA] unregister platform devices Call platform_device_unregister() for all platform devices that we've registered. Signed-off-by: Clemens Ladisch --- sound/isa/opti9xx/opti92x-ad1848.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'sound/isa/opti9xx') 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); } -- cgit v1.2.1