aboutsummaryrefslogtreecommitdiffstats
path: root/sound/isa/es1688
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2005-12-07 03:13:42 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:39 -0500
commitf7a9275d949cb0bf1f259a1546e52a0bf518151c (patch)
tree4d96d9b6196d43684903857ba676dc51bbde4026 /sound/isa/es1688
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/es1688')
-rw-r--r--sound/isa/es1688/es1688.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sound/isa/es1688/es1688.c b/sound/isa/es1688/es1688.c
index 68bd40a76f01..50d23cf3d7cc 100644
--- a/sound/isa/es1688/es1688.c
+++ b/sound/isa/es1688/es1688.c
@@ -69,6 +69,8 @@ MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for ESx688 driver.");
69module_param_array(dma8, int, NULL, 0444); 69module_param_array(dma8, int, NULL, 0444);
70MODULE_PARM_DESC(dma8, "8-bit DMA # for ESx688 driver."); 70MODULE_PARM_DESC(dma8, "8-bit DMA # for ESx688 driver.");
71 71
72static struct platform_device *devices[SNDRV_CARDS];
73
72#define PFX "es1688: " 74#define PFX "es1688: "
73 75
74static int __init snd_es1688_probe(struct platform_device *pdev) 76static int __init snd_es1688_probe(struct platform_device *pdev)
@@ -187,6 +189,15 @@ static struct platform_driver snd_es1688_driver = {
187 }, 189 },
188}; 190};
189 191
192static void __init_or_module snd_es1688_unregister_all(void)
193{
194 int i;
195
196 for (i = 0; i < ARRAY_SIZE(devices); ++i)
197 platform_device_unregister(devices[i]);
198 platform_driver_unregister(&snd_es1688_driver);
199}
200
190static int __init alsa_card_es1688_init(void) 201static int __init alsa_card_es1688_init(void)
191{ 202{
192 int i, cards, err; 203 int i, cards, err;
@@ -204,6 +215,7 @@ static int __init alsa_card_es1688_init(void)
204 err = PTR_ERR(device); 215 err = PTR_ERR(device);
205 goto errout; 216 goto errout;
206 } 217 }
218 devices[i] = device;
207 cards++; 219 cards++;
208 } 220 }
209 if (!cards) { 221 if (!cards) {
@@ -216,13 +228,13 @@ static int __init alsa_card_es1688_init(void)
216 return 0; 228 return 0;
217 229
218 errout: 230 errout:
219 platform_driver_unregister(&snd_es1688_driver); 231 snd_es1688_unregister_all();
220 return err; 232 return err;
221} 233}
222 234
223static void __exit alsa_card_es1688_exit(void) 235static void __exit alsa_card_es1688_exit(void)
224{ 236{
225 platform_driver_unregister(&snd_es1688_driver); 237 snd_es1688_unregister_all();
226} 238}
227 239
228module_init(alsa_card_es1688_init) 240module_init(alsa_card_es1688_init)