aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
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 /include/sound
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 'include/sound')
-rw-r--r--include/sound/core.h3
-rw-r--r--include/sound/timer.h1
2 files changed, 2 insertions, 2 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index bab3ff457e40..cf4001cf6248 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -71,7 +71,6 @@ struct snd_device_ops {
71 int (*dev_free)(struct snd_device *dev); 71 int (*dev_free)(struct snd_device *dev);
72 int (*dev_register)(struct snd_device *dev); 72 int (*dev_register)(struct snd_device *dev);
73 int (*dev_disconnect)(struct snd_device *dev); 73 int (*dev_disconnect)(struct snd_device *dev);
74 int (*dev_unregister)(struct snd_device *dev);
75}; 74};
76 75
77struct snd_device { 76struct snd_device {
@@ -131,6 +130,7 @@ struct snd_card {
131 state */ 130 state */
132 spinlock_t files_lock; /* lock the files for this card */ 131 spinlock_t files_lock; /* lock the files for this card */
133 int shutdown; /* this card is going down */ 132 int shutdown; /* this card is going down */
133 int free_on_last_close; /* free in context of file_release */
134 wait_queue_head_t shutdown_sleep; 134 wait_queue_head_t shutdown_sleep;
135 struct work_struct free_workq; /* for free in workqueue */ 135 struct work_struct free_workq; /* for free in workqueue */
136 struct device *dev; 136 struct device *dev;
@@ -244,6 +244,7 @@ struct snd_card *snd_card_new(int idx, const char *id,
244 struct module *module, int extra_size); 244 struct module *module, int extra_size);
245int snd_card_disconnect(struct snd_card *card); 245int snd_card_disconnect(struct snd_card *card);
246int snd_card_free(struct snd_card *card); 246int snd_card_free(struct snd_card *card);
247int snd_card_free_when_closed(struct snd_card *card);
247int snd_card_free_in_thread(struct snd_card *card); 248int snd_card_free_in_thread(struct snd_card *card);
248int snd_card_register(struct snd_card *card); 249int snd_card_register(struct snd_card *card);
249int snd_card_info_init(void); 250int snd_card_info_init(void);
diff --git a/include/sound/timer.h b/include/sound/timer.h
index 5ece2bf541dc..d42c083db1da 100644
--- a/include/sound/timer.h
+++ b/include/sound/timer.h
@@ -129,7 +129,6 @@ void snd_timer_notify(struct snd_timer *timer, int event, struct timespec *tstam
129int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer); 129int snd_timer_global_new(char *id, int device, struct snd_timer **rtimer);
130int snd_timer_global_free(struct snd_timer *timer); 130int snd_timer_global_free(struct snd_timer *timer);
131int snd_timer_global_register(struct snd_timer *timer); 131int snd_timer_global_register(struct snd_timer *timer);
132int snd_timer_global_unregister(struct snd_timer *timer);
133 132
134int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id); 133int snd_timer_open(struct snd_timer_instance **ti, char *owner, struct snd_timer_id *tid, unsigned int slave_id);
135int snd_timer_close(struct snd_timer_instance *timeri); 134int snd_timer_close(struct snd_timer_instance *timeri);