summaryrefslogtreecommitdiffstats
path: root/include/sound/core.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-01-29 12:13:43 +0100
committerTakashi Iwai <tiwai@suse.de>2014-02-14 08:14:13 +0100
commitf24640648186b59bd39f8cd640d631bdb61a3197 (patch)
treea73d73fd6d100ace77a0f67d7af3df367251d1bc /include/sound/core.h
parent34356dbdb64e9f12cc8ce1bb0d9e38a75b1e4638 (diff)
downloadlinux-f24640648186b59bd39f8cd640d631bdb61a3197.tar.bz2
ALSA: Use standard device refcount for card accounting
Drop the own refcount but use the standard device refcounting via get_device() and put_device(). Introduce a new completion to snd_card instead of the wait queue for syncing the last release, which is used in snd_card_free(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound/core.h')
-rw-r--r--include/sound/core.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/sound/core.h b/include/sound/core.h
index 7e4fb3e93fc7..4519dac98363 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -42,6 +42,7 @@
/* forward declarations */
struct pci_dev;
struct module;
+struct completion;
/* device allocation stuff */
@@ -130,9 +131,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;
- atomic_t refcount; /* refcount for disconnection */
+ struct completion *release_completion;
struct device *dev; /* device assigned to this card */
struct device card_dev; /* cardX object for sysfs */
bool registered; /* card_dev is registered? */
@@ -306,7 +305,7 @@ int snd_card_info_done(void);
int snd_component_add(struct snd_card *card, const char *component);
int snd_card_file_add(struct snd_card *card, struct file *file);
int snd_card_file_remove(struct snd_card *card, struct file *file);
-void snd_card_unref(struct snd_card *card);
+#define snd_card_unref(card) put_device(&(card)->card_dev)
#define snd_card_set_dev(card, devptr) ((card)->dev = (devptr))