diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2005-12-07 03:13:42 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-01-03 06:30:39 -0500 |
commit | f7a9275d949cb0bf1f259a1546e52a0bf518151c (patch) | |
tree | 4d96d9b6196d43684903857ba676dc51bbde4026 /sound/isa/opti9xx/opti92x-ad1848.c | |
parent | 416c1079d30f1a52399b96f6772e993274b774ae (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/opti9xx/opti92x-ad1848.c')
-rw-r--r-- | sound/isa/opti9xx/opti92x-ad1848.c | 9 |
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 { | |||
259 | }; | 259 | }; |
260 | 260 | ||
261 | static int snd_opti9xx_pnp_is_probed; | 261 | static int snd_opti9xx_pnp_is_probed; |
262 | static struct platform_device *snd_opti9xx_platform_device; | ||
262 | 263 | ||
263 | #ifdef CONFIG_PNP | 264 | #ifdef CONFIG_PNP |
264 | 265 | ||
@@ -2095,8 +2096,10 @@ static int __init alsa_card_opti9xx_init(void) | |||
2095 | if (error < 0) | 2096 | if (error < 0) |
2096 | return error; | 2097 | return error; |
2097 | device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); | 2098 | device = platform_device_register_simple(DRIVER_NAME, -1, NULL, 0); |
2098 | if (! IS_ERR(device)) | 2099 | if (!IS_ERR(device)) { |
2100 | snd_opti9xx_platform_device = device; | ||
2099 | return 0; | 2101 | return 0; |
2102 | } | ||
2100 | platform_driver_unregister(&snd_opti9xx_driver); | 2103 | platform_driver_unregister(&snd_opti9xx_driver); |
2101 | } | 2104 | } |
2102 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); | 2105 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); |
@@ -2108,8 +2111,10 @@ static int __init alsa_card_opti9xx_init(void) | |||
2108 | 2111 | ||
2109 | static void __exit alsa_card_opti9xx_exit(void) | 2112 | static void __exit alsa_card_opti9xx_exit(void) |
2110 | { | 2113 | { |
2111 | if (! snd_opti9xx_pnp_is_probed) | 2114 | if (!snd_opti9xx_pnp_is_probed) { |
2115 | platform_device_unregister(snd_opti9xx_platform_device); | ||
2112 | platform_driver_unregister(&snd_opti9xx_driver); | 2116 | platform_driver_unregister(&snd_opti9xx_driver); |
2117 | } | ||
2113 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); | 2118 | pnp_unregister_card_driver(&opti9xx_pnpc_driver); |
2114 | } | 2119 | } |
2115 | 2120 | ||