summaryrefslogtreecommitdiffstats
path: root/include/sound/core.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-23 14:38:23 +0200
committerJaroslav Kysela <perex@suse.cz>2006-09-23 10:36:58 +0200
commitc461482c8072bb073e6146db320d3da85cdc89ad (patch)
tree3b69cfd292a488a8cb57ac9b040bd2b1b1a1e26d /include/sound/core.h
parent746d4a02e68499fc6c1f8d0c43d2271853ade181 (diff)
downloadblackbird-op-linux-c461482c8072bb073e6146db320d3da85cdc89ad.tar.gz
blackbird-op-linux-c461482c8072bb073e6146db320d3da85cdc89ad.zip
[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/core.h')
-rw-r--r--include/sound/core.h3
1 files changed, 2 insertions, 1 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 {
int (*dev_free)(struct snd_device *dev);
int (*dev_register)(struct snd_device *dev);
int (*dev_disconnect)(struct snd_device *dev);
- int (*dev_unregister)(struct snd_device *dev);
};
struct snd_device {
@@ -131,6 +130,7 @@ struct snd_card {
state */
spinlock_t files_lock; /* lock the files for this card */
int shutdown; /* this card is going down */
+ int free_on_last_close; /* free in context of file_release */
wait_queue_head_t shutdown_sleep;
struct work_struct free_workq; /* for free in workqueue */
struct device *dev;
@@ -244,6 +244,7 @@ struct snd_card *snd_card_new(int idx, const char *id,
struct module *module, int extra_size);
int snd_card_disconnect(struct snd_card *card);
int snd_card_free(struct snd_card *card);
+int snd_card_free_when_closed(struct snd_card *card);
int snd_card_free_in_thread(struct snd_card *card);
int snd_card_register(struct snd_card *card);
int snd_card_info_init(void);
OpenPOWER on IntegriCloud