summaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_queue.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-08-31 14:20:06 +0200
committerIngo Molnar <mingo@kernel.org>2017-08-31 14:20:06 +0200
commit3e83dfd5d8e374328078f527f1f7d189824896ab (patch)
tree2f82b2e82f7a4b5c513fed42d4228a8bce938180 /sound/core/seq/seq_queue.c
parent3308376a914b9c3f57a12072c063814403d983a8 (diff)
parent9e52fc2b50de3a1c08b44f94c610fbe998c0031a (diff)
downloadlinux-3e83dfd5d8e374328078f527f1f7d189824896ab.tar.bz2
Merge branch 'x86/mm' into x86/platform, to pick up TLB flush dependency
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'sound/core/seq/seq_queue.c')
-rw-r--r--sound/core/seq/seq_queue.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index 450c5187eecb..79e0c5604ef8 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -184,22 +184,26 @@ void __exit snd_seq_queues_delete(void)
static void queue_use(struct snd_seq_queue *queue, int client, int use);
/* allocate a new queue -
- * return queue index value or negative value for error
+ * return pointer to new queue or ERR_PTR(-errno) for error
+ * The new queue's use_lock is set to 1. It is the caller's responsibility to
+ * call snd_use_lock_free(&q->use_lock).
*/
-int snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
+struct snd_seq_queue *snd_seq_queue_alloc(int client, int locked, unsigned int info_flags)
{
struct snd_seq_queue *q;
q = queue_new(client, locked);
if (q == NULL)
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
q->info_flags = info_flags;
queue_use(q, client, 1);
+ snd_use_lock_use(&q->use_lock);
if (queue_list_add(q) < 0) {
+ snd_use_lock_free(&q->use_lock);
queue_delete(q);
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
}
- return q->queue;
+ return q;
}
/* delete a queue - queue must be owned by the client */