aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-23 08:38:23 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:36:58 -0400
commitc461482c8072bb073e6146db320d3da85cdc89ad (patch)
tree3b69cfd292a488a8cb57ac9b040bd2b1b1a1e26d /sound/core/seq
parent746d4a02e68499fc6c1f8d0c43d2271853ade181 (diff)
[ALSA] Unregister device files at disconnection
Orignally proposed by Sam Revitch <sam.revitch@gmail.com>. Unregister device files at disconnection to avoid the futher accesses. Also, the dev_unregister callback is removed and replaced with the combination of disconnect + free. A new function snd_card_free_when_closed() is introduced, which is used in USB disconnect callback. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/seq')
-rw-r--r--sound/core/seq/seq_device.c11
1 files changed, 0 insertions, 11 deletions
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index b85954e956d..b79d011813c 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -90,7 +90,6 @@ static int snd_seq_device_free(struct snd_seq_device *dev);
90static int snd_seq_device_dev_free(struct snd_device *device); 90static int snd_seq_device_dev_free(struct snd_device *device);
91static int snd_seq_device_dev_register(struct snd_device *device); 91static int snd_seq_device_dev_register(struct snd_device *device);
92static int snd_seq_device_dev_disconnect(struct snd_device *device); 92static int snd_seq_device_dev_disconnect(struct snd_device *device);
93static int snd_seq_device_dev_unregister(struct snd_device *device);
94 93
95static int init_device(struct snd_seq_device *dev, struct ops_list *ops); 94static int init_device(struct snd_seq_device *dev, struct ops_list *ops);
96static int free_device(struct snd_seq_device *dev, struct ops_list *ops); 95static int free_device(struct snd_seq_device *dev, struct ops_list *ops);
@@ -189,7 +188,6 @@ int snd_seq_device_new(struct snd_card *card, int device, char *id, int argsize,
189 .dev_free = snd_seq_device_dev_free, 188 .dev_free = snd_seq_device_dev_free,
190 .dev_register = snd_seq_device_dev_register, 189 .dev_register = snd_seq_device_dev_register,
191 .dev_disconnect = snd_seq_device_dev_disconnect, 190 .dev_disconnect = snd_seq_device_dev_disconnect,
192 .dev_unregister = snd_seq_device_dev_unregister
193 }; 191 };
194 192
195 if (result) 193 if (result)
@@ -309,15 +307,6 @@ static int snd_seq_device_dev_disconnect(struct snd_device *device)
309} 307}
310 308
311/* 309/*
312 * unregister the existing device
313 */
314static int snd_seq_device_dev_unregister(struct snd_device *device)
315{
316 struct snd_seq_device *dev = device->device_data;
317 return snd_seq_device_free(dev);
318}
319
320/*
321 * register device driver 310 * register device driver
322 * id = driver id 311 * id = driver id
323 * entry = driver operators - duplicated to each instance 312 * entry = driver operators - duplicated to each instance