diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-16 10:29:08 -0500 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 04:24:50 -0500 |
commit | 1a60d4c5a0c4028559585a74e48593b16e1ca9b2 (patch) | |
tree | f03f8dfcd554f8ebbb295522dc46dfe4d110a484 /sound/core/seq | |
parent | f0283f45a04d5cf31512e5e390a38504d97e7a97 (diff) |
[ALSA] semaphore -> mutex (core part)
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq')
-rw-r--r-- | sound/core/seq/oss/seq_oss.c | 27 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.c | 40 | ||||
-rw-r--r-- | sound/core/seq/seq_clientmgr.h | 2 | ||||
-rw-r--r-- | sound/core/seq/seq_device.c | 53 | ||||
-rw-r--r-- | sound/core/seq/seq_instr.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_midi.c | 20 | ||||
-rw-r--r-- | sound/core/seq/seq_ports.c | 12 | ||||
-rw-r--r-- | sound/core/seq/seq_queue.c | 6 | ||||
-rw-r--r-- | sound/core/seq/seq_queue.h | 2 |
9 files changed, 85 insertions, 83 deletions
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c index c98f0ba13810..b9919785180b 100644 --- a/sound/core/seq/oss/seq_oss.c +++ b/sound/core/seq/oss/seq_oss.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/smp_lock.h> | 25 | #include <linux/smp_lock.h> |
26 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
27 | #include <linux/mutex.h> | ||
27 | #include <sound/core.h> | 28 | #include <sound/core.h> |
28 | #include <sound/minors.h> | 29 | #include <sound/minors.h> |
29 | #include <sound/initval.h> | 30 | #include <sound/initval.h> |
@@ -124,7 +125,7 @@ module_exit(alsa_seq_oss_exit) | |||
124 | * ALSA minor device interface | 125 | * ALSA minor device interface |
125 | */ | 126 | */ |
126 | 127 | ||
127 | static DECLARE_MUTEX(register_mutex); | 128 | static DEFINE_MUTEX(register_mutex); |
128 | 129 | ||
129 | static int | 130 | static int |
130 | odev_open(struct inode *inode, struct file *file) | 131 | odev_open(struct inode *inode, struct file *file) |
@@ -136,9 +137,9 @@ odev_open(struct inode *inode, struct file *file) | |||
136 | else | 137 | else |
137 | level = SNDRV_SEQ_OSS_MODE_SYNTH; | 138 | level = SNDRV_SEQ_OSS_MODE_SYNTH; |
138 | 139 | ||
139 | down(®ister_mutex); | 140 | mutex_lock(®ister_mutex); |
140 | rc = snd_seq_oss_open(file, level); | 141 | rc = snd_seq_oss_open(file, level); |
141 | up(®ister_mutex); | 142 | mutex_unlock(®ister_mutex); |
142 | 143 | ||
143 | return rc; | 144 | return rc; |
144 | } | 145 | } |
@@ -153,9 +154,9 @@ odev_release(struct inode *inode, struct file *file) | |||
153 | 154 | ||
154 | snd_seq_oss_drain_write(dp); | 155 | snd_seq_oss_drain_write(dp); |
155 | 156 | ||
156 | down(®ister_mutex); | 157 | mutex_lock(®ister_mutex); |
157 | snd_seq_oss_release(dp); | 158 | snd_seq_oss_release(dp); |
158 | up(®ister_mutex); | 159 | mutex_unlock(®ister_mutex); |
159 | 160 | ||
160 | return 0; | 161 | return 0; |
161 | } | 162 | } |
@@ -224,13 +225,13 @@ register_device(void) | |||
224 | { | 225 | { |
225 | int rc; | 226 | int rc; |
226 | 227 | ||
227 | down(®ister_mutex); | 228 | mutex_lock(®ister_mutex); |
228 | if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, | 229 | if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, |
229 | NULL, 0, | 230 | NULL, 0, |
230 | &seq_oss_f_ops, NULL, | 231 | &seq_oss_f_ops, NULL, |
231 | SNDRV_SEQ_OSS_DEVNAME)) < 0) { | 232 | SNDRV_SEQ_OSS_DEVNAME)) < 0) { |
232 | snd_printk(KERN_ERR "can't register device seq\n"); | 233 | snd_printk(KERN_ERR "can't register device seq\n"); |
233 | up(®ister_mutex); | 234 | mutex_unlock(®ister_mutex); |
234 | return rc; | 235 | return rc; |
235 | } | 236 | } |
236 | if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, | 237 | if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, |
@@ -239,24 +240,24 @@ register_device(void) | |||
239 | SNDRV_SEQ_OSS_DEVNAME)) < 0) { | 240 | SNDRV_SEQ_OSS_DEVNAME)) < 0) { |
240 | snd_printk(KERN_ERR "can't register device music\n"); | 241 | snd_printk(KERN_ERR "can't register device music\n"); |
241 | snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0); | 242 | snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0); |
242 | up(®ister_mutex); | 243 | mutex_unlock(®ister_mutex); |
243 | return rc; | 244 | return rc; |
244 | } | 245 | } |
245 | debug_printk(("device registered\n")); | 246 | debug_printk(("device registered\n")); |
246 | up(®ister_mutex); | 247 | mutex_unlock(®ister_mutex); |
247 | return 0; | 248 | return 0; |
248 | } | 249 | } |
249 | 250 | ||
250 | static void | 251 | static void |
251 | unregister_device(void) | 252 | unregister_device(void) |
252 | { | 253 | { |
253 | down(®ister_mutex); | 254 | mutex_lock(®ister_mutex); |
254 | debug_printk(("device unregistered\n")); | 255 | debug_printk(("device unregistered\n")); |
255 | if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0) | 256 | if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0) |
256 | snd_printk(KERN_ERR "error unregister device music\n"); | 257 | snd_printk(KERN_ERR "error unregister device music\n"); |
257 | if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0) | 258 | if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0) |
258 | snd_printk(KERN_ERR "error unregister device seq\n"); | 259 | snd_printk(KERN_ERR "error unregister device seq\n"); |
259 | up(®ister_mutex); | 260 | mutex_unlock(®ister_mutex); |
260 | } | 261 | } |
261 | 262 | ||
262 | /* | 263 | /* |
@@ -270,12 +271,12 @@ static struct snd_info_entry *info_entry; | |||
270 | static void | 271 | static void |
271 | info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf) | 272 | info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf) |
272 | { | 273 | { |
273 | down(®ister_mutex); | 274 | mutex_lock(®ister_mutex); |
274 | snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR); | 275 | snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR); |
275 | snd_seq_oss_system_info_read(buf); | 276 | snd_seq_oss_system_info_read(buf); |
276 | snd_seq_oss_synth_info_read(buf); | 277 | snd_seq_oss_synth_info_read(buf); |
277 | snd_seq_oss_midi_info_read(buf); | 278 | snd_seq_oss_midi_info_read(buf); |
278 | up(®ister_mutex); | 279 | mutex_unlock(®ister_mutex); |
279 | } | 280 | } |
280 | 281 | ||
281 | 282 | ||
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index fd2032eae214..aae6420f5948 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c | |||
@@ -67,7 +67,7 @@ | |||
67 | #define SNDRV_SEQ_LFLG_OPEN (SNDRV_SEQ_LFLG_INPUT|SNDRV_SEQ_LFLG_OUTPUT) | 67 | #define SNDRV_SEQ_LFLG_OPEN (SNDRV_SEQ_LFLG_INPUT|SNDRV_SEQ_LFLG_OUTPUT) |
68 | 68 | ||
69 | static DEFINE_SPINLOCK(clients_lock); | 69 | static DEFINE_SPINLOCK(clients_lock); |
70 | static DECLARE_MUTEX(register_mutex); | 70 | static DEFINE_MUTEX(register_mutex); |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * client table | 73 | * client table |
@@ -237,7 +237,7 @@ static struct snd_seq_client *seq_create_client1(int client_index, int poolsize) | |||
237 | client->type = NO_CLIENT; | 237 | client->type = NO_CLIENT; |
238 | snd_use_lock_init(&client->use_lock); | 238 | snd_use_lock_init(&client->use_lock); |
239 | rwlock_init(&client->ports_lock); | 239 | rwlock_init(&client->ports_lock); |
240 | init_MUTEX(&client->ports_mutex); | 240 | mutex_init(&client->ports_mutex); |
241 | INIT_LIST_HEAD(&client->ports_list_head); | 241 | INIT_LIST_HEAD(&client->ports_list_head); |
242 | 242 | ||
243 | /* find free slot in the client table */ | 243 | /* find free slot in the client table */ |
@@ -290,7 +290,7 @@ static int seq_free_client1(struct snd_seq_client *client) | |||
290 | 290 | ||
291 | static void seq_free_client(struct snd_seq_client * client) | 291 | static void seq_free_client(struct snd_seq_client * client) |
292 | { | 292 | { |
293 | down(®ister_mutex); | 293 | mutex_lock(®ister_mutex); |
294 | switch (client->type) { | 294 | switch (client->type) { |
295 | case NO_CLIENT: | 295 | case NO_CLIENT: |
296 | snd_printk(KERN_WARNING "Seq: Trying to free unused client %d\n", | 296 | snd_printk(KERN_WARNING "Seq: Trying to free unused client %d\n", |
@@ -306,7 +306,7 @@ static void seq_free_client(struct snd_seq_client * client) | |||
306 | snd_printk(KERN_ERR "Seq: Trying to free client %d with undefined type = %d\n", | 306 | snd_printk(KERN_ERR "Seq: Trying to free client %d with undefined type = %d\n", |
307 | client->number, client->type); | 307 | client->number, client->type); |
308 | } | 308 | } |
309 | up(®ister_mutex); | 309 | mutex_unlock(®ister_mutex); |
310 | 310 | ||
311 | snd_seq_system_client_ev_client_exit(client->number); | 311 | snd_seq_system_client_ev_client_exit(client->number); |
312 | } | 312 | } |
@@ -322,11 +322,11 @@ static int snd_seq_open(struct inode *inode, struct file *file) | |||
322 | struct snd_seq_client *client; | 322 | struct snd_seq_client *client; |
323 | struct snd_seq_user_client *user; | 323 | struct snd_seq_user_client *user; |
324 | 324 | ||
325 | if (down_interruptible(®ister_mutex)) | 325 | if (mutex_lock_interruptible(®ister_mutex)) |
326 | return -ERESTARTSYS; | 326 | return -ERESTARTSYS; |
327 | client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); | 327 | client = seq_create_client1(-1, SNDRV_SEQ_DEFAULT_EVENTS); |
328 | if (client == NULL) { | 328 | if (client == NULL) { |
329 | up(®ister_mutex); | 329 | mutex_unlock(®ister_mutex); |
330 | return -ENOMEM; /* failure code */ | 330 | return -ENOMEM; /* failure code */ |
331 | } | 331 | } |
332 | 332 | ||
@@ -346,14 +346,14 @@ static int snd_seq_open(struct inode *inode, struct file *file) | |||
346 | if (user->fifo == NULL) { | 346 | if (user->fifo == NULL) { |
347 | seq_free_client1(client); | 347 | seq_free_client1(client); |
348 | kfree(client); | 348 | kfree(client); |
349 | up(®ister_mutex); | 349 | mutex_unlock(®ister_mutex); |
350 | return -ENOMEM; | 350 | return -ENOMEM; |
351 | } | 351 | } |
352 | } | 352 | } |
353 | 353 | ||
354 | usage_alloc(&client_usage, 1); | 354 | usage_alloc(&client_usage, 1); |
355 | client->type = USER_CLIENT; | 355 | client->type = USER_CLIENT; |
356 | up(®ister_mutex); | 356 | mutex_unlock(®ister_mutex); |
357 | 357 | ||
358 | c = client->number; | 358 | c = client->number; |
359 | file->private_data = client; | 359 | file->private_data = client; |
@@ -1743,7 +1743,7 @@ static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, | |||
1743 | if (queue == NULL) | 1743 | if (queue == NULL) |
1744 | return -EINVAL; | 1744 | return -EINVAL; |
1745 | 1745 | ||
1746 | if (down_interruptible(&queue->timer_mutex)) { | 1746 | if (mutex_lock_interruptible(&queue->timer_mutex)) { |
1747 | queuefree(queue); | 1747 | queuefree(queue); |
1748 | return -ERESTARTSYS; | 1748 | return -ERESTARTSYS; |
1749 | } | 1749 | } |
@@ -1756,7 +1756,7 @@ static int snd_seq_ioctl_get_queue_timer(struct snd_seq_client *client, | |||
1756 | timer.u.alsa.id = tmr->alsa_id; | 1756 | timer.u.alsa.id = tmr->alsa_id; |
1757 | timer.u.alsa.resolution = tmr->preferred_resolution; | 1757 | timer.u.alsa.resolution = tmr->preferred_resolution; |
1758 | } | 1758 | } |
1759 | up(&queue->timer_mutex); | 1759 | mutex_unlock(&queue->timer_mutex); |
1760 | queuefree(queue); | 1760 | queuefree(queue); |
1761 | 1761 | ||
1762 | if (copy_to_user(arg, &timer, sizeof(timer))) | 1762 | if (copy_to_user(arg, &timer, sizeof(timer))) |
@@ -1785,7 +1785,7 @@ static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client, | |||
1785 | q = queueptr(timer.queue); | 1785 | q = queueptr(timer.queue); |
1786 | if (q == NULL) | 1786 | if (q == NULL) |
1787 | return -ENXIO; | 1787 | return -ENXIO; |
1788 | if (down_interruptible(&q->timer_mutex)) { | 1788 | if (mutex_lock_interruptible(&q->timer_mutex)) { |
1789 | queuefree(q); | 1789 | queuefree(q); |
1790 | return -ERESTARTSYS; | 1790 | return -ERESTARTSYS; |
1791 | } | 1791 | } |
@@ -1797,7 +1797,7 @@ static int snd_seq_ioctl_set_queue_timer(struct snd_seq_client *client, | |||
1797 | tmr->preferred_resolution = timer.u.alsa.resolution; | 1797 | tmr->preferred_resolution = timer.u.alsa.resolution; |
1798 | } | 1798 | } |
1799 | result = snd_seq_queue_timer_open(timer.queue); | 1799 | result = snd_seq_queue_timer_open(timer.queue); |
1800 | up(&q->timer_mutex); | 1800 | mutex_unlock(&q->timer_mutex); |
1801 | queuefree(q); | 1801 | queuefree(q); |
1802 | } else { | 1802 | } else { |
1803 | return -EPERM; | 1803 | return -EPERM; |
@@ -2230,7 +2230,7 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index, | |||
2230 | if (card == NULL && client_index >= SNDRV_SEQ_GLOBAL_CLIENTS) | 2230 | if (card == NULL && client_index >= SNDRV_SEQ_GLOBAL_CLIENTS) |
2231 | return -EINVAL; | 2231 | return -EINVAL; |
2232 | 2232 | ||
2233 | if (down_interruptible(®ister_mutex)) | 2233 | if (mutex_lock_interruptible(®ister_mutex)) |
2234 | return -ERESTARTSYS; | 2234 | return -ERESTARTSYS; |
2235 | 2235 | ||
2236 | if (card) { | 2236 | if (card) { |
@@ -2243,7 +2243,7 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index, | |||
2243 | /* empty write queue as default */ | 2243 | /* empty write queue as default */ |
2244 | client = seq_create_client1(client_index, 0); | 2244 | client = seq_create_client1(client_index, 0); |
2245 | if (client == NULL) { | 2245 | if (client == NULL) { |
2246 | up(®ister_mutex); | 2246 | mutex_unlock(®ister_mutex); |
2247 | return -EBUSY; /* failure code */ | 2247 | return -EBUSY; /* failure code */ |
2248 | } | 2248 | } |
2249 | usage_alloc(&client_usage, 1); | 2249 | usage_alloc(&client_usage, 1); |
@@ -2256,7 +2256,7 @@ int snd_seq_create_kernel_client(struct snd_card *card, int client_index, | |||
2256 | va_end(args); | 2256 | va_end(args); |
2257 | 2257 | ||
2258 | client->type = KERNEL_CLIENT; | 2258 | client->type = KERNEL_CLIENT; |
2259 | up(®ister_mutex); | 2259 | mutex_unlock(®ister_mutex); |
2260 | 2260 | ||
2261 | /* make others aware this new client */ | 2261 | /* make others aware this new client */ |
2262 | snd_seq_system_client_ev_client_start(client->number); | 2262 | snd_seq_system_client_ev_client_start(client->number); |
@@ -2464,7 +2464,7 @@ static void snd_seq_info_dump_ports(struct snd_info_buffer *buffer, | |||
2464 | { | 2464 | { |
2465 | struct list_head *l; | 2465 | struct list_head *l; |
2466 | 2466 | ||
2467 | down(&client->ports_mutex); | 2467 | mutex_lock(&client->ports_mutex); |
2468 | list_for_each(l, &client->ports_list_head) { | 2468 | list_for_each(l, &client->ports_list_head) { |
2469 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); | 2469 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); |
2470 | snd_iprintf(buffer, " Port %3d : \"%s\" (%c%c%c%c)\n", | 2470 | snd_iprintf(buffer, " Port %3d : \"%s\" (%c%c%c%c)\n", |
@@ -2476,7 +2476,7 @@ static void snd_seq_info_dump_ports(struct snd_info_buffer *buffer, | |||
2476 | snd_seq_info_dump_subscribers(buffer, &p->c_src, 1, " Connecting To: "); | 2476 | snd_seq_info_dump_subscribers(buffer, &p->c_src, 1, " Connecting To: "); |
2477 | snd_seq_info_dump_subscribers(buffer, &p->c_dest, 0, " Connected From: "); | 2477 | snd_seq_info_dump_subscribers(buffer, &p->c_dest, 0, " Connected From: "); |
2478 | } | 2478 | } |
2479 | up(&client->ports_mutex); | 2479 | mutex_unlock(&client->ports_mutex); |
2480 | } | 2480 | } |
2481 | 2481 | ||
2482 | 2482 | ||
@@ -2550,16 +2550,16 @@ int __init snd_sequencer_device_init(void) | |||
2550 | { | 2550 | { |
2551 | int err; | 2551 | int err; |
2552 | 2552 | ||
2553 | if (down_interruptible(®ister_mutex)) | 2553 | if (mutex_lock_interruptible(®ister_mutex)) |
2554 | return -ERESTARTSYS; | 2554 | return -ERESTARTSYS; |
2555 | 2555 | ||
2556 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, | 2556 | if ((err = snd_register_device(SNDRV_DEVICE_TYPE_SEQUENCER, NULL, 0, |
2557 | &snd_seq_f_ops, NULL, "seq")) < 0) { | 2557 | &snd_seq_f_ops, NULL, "seq")) < 0) { |
2558 | up(®ister_mutex); | 2558 | mutex_unlock(®ister_mutex); |
2559 | return err; | 2559 | return err; |
2560 | } | 2560 | } |
2561 | 2561 | ||
2562 | up(®ister_mutex); | 2562 | mutex_unlock(®ister_mutex); |
2563 | 2563 | ||
2564 | return 0; | 2564 | return 0; |
2565 | } | 2565 | } |
diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h index 450091ca153d..5e04e20e239f 100644 --- a/sound/core/seq/seq_clientmgr.h +++ b/sound/core/seq/seq_clientmgr.h | |||
@@ -58,7 +58,7 @@ struct snd_seq_client { | |||
58 | int num_ports; /* number of ports */ | 58 | int num_ports; /* number of ports */ |
59 | struct list_head ports_list_head; | 59 | struct list_head ports_list_head; |
60 | rwlock_t ports_lock; | 60 | rwlock_t ports_lock; |
61 | struct semaphore ports_mutex; | 61 | struct mutex ports_mutex; |
62 | int convert32; /* convert 32->64bit */ | 62 | int convert32; /* convert 32->64bit */ |
63 | 63 | ||
64 | /* output pool */ | 64 | /* output pool */ |
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c index 9ece443fba55..d9a3e5a18d6a 100644 --- a/sound/core/seq/seq_device.c +++ b/sound/core/seq/seq_device.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <sound/initval.h> | 45 | #include <sound/initval.h> |
46 | #include <linux/kmod.h> | 46 | #include <linux/kmod.h> |
47 | #include <linux/slab.h> | 47 | #include <linux/slab.h> |
48 | #include <linux/mutex.h> | ||
48 | 49 | ||
49 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); | 50 | MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>"); |
50 | MODULE_DESCRIPTION("ALSA sequencer device management"); | 51 | MODULE_DESCRIPTION("ALSA sequencer device management"); |
@@ -69,7 +70,7 @@ struct ops_list { | |||
69 | struct list_head dev_list; /* list of devices */ | 70 | struct list_head dev_list; /* list of devices */ |
70 | int num_devices; /* number of associated devices */ | 71 | int num_devices; /* number of associated devices */ |
71 | int num_init_devices; /* number of initialized devices */ | 72 | int num_init_devices; /* number of initialized devices */ |
72 | struct semaphore reg_mutex; | 73 | struct mutex reg_mutex; |
73 | 74 | ||
74 | struct list_head list; /* next driver */ | 75 | struct list_head list; /* next driver */ |
75 | }; | 76 | }; |
@@ -77,7 +78,7 @@ struct ops_list { | |||
77 | 78 | ||
78 | static LIST_HEAD(opslist); | 79 | static LIST_HEAD(opslist); |
79 | static int num_ops; | 80 | static int num_ops; |
80 | static DECLARE_MUTEX(ops_mutex); | 81 | static DEFINE_MUTEX(ops_mutex); |
81 | #ifdef CONFIG_PROC_FS | 82 | #ifdef CONFIG_PROC_FS |
82 | static struct snd_info_entry *info_entry = NULL; | 83 | static struct snd_info_entry *info_entry = NULL; |
83 | #endif | 84 | #endif |
@@ -108,7 +109,7 @@ static void snd_seq_device_info(struct snd_info_entry *entry, | |||
108 | { | 109 | { |
109 | struct list_head *head; | 110 | struct list_head *head; |
110 | 111 | ||
111 | down(&ops_mutex); | 112 | mutex_lock(&ops_mutex); |
112 | list_for_each(head, &opslist) { | 113 | list_for_each(head, &opslist) { |
113 | struct ops_list *ops = list_entry(head, struct ops_list, list); | 114 | struct ops_list *ops = list_entry(head, struct ops_list, list); |
114 | snd_iprintf(buffer, "snd-%s%s%s%s,%d\n", | 115 | snd_iprintf(buffer, "snd-%s%s%s%s,%d\n", |
@@ -118,7 +119,7 @@ static void snd_seq_device_info(struct snd_info_entry *entry, | |||
118 | ops->driver & DRIVER_LOCKED ? ",locked" : "", | 119 | ops->driver & DRIVER_LOCKED ? ",locked" : "", |
119 | ops->num_devices); | 120 | ops->num_devices); |
120 | } | 121 | } |
121 | up(&ops_mutex); | 122 | mutex_unlock(&ops_mutex); |
122 | } | 123 | } |
123 | #endif | 124 | #endif |
124 | 125 | ||
@@ -154,20 +155,20 @@ void snd_seq_device_load_drivers(void) | |||
154 | if (! current->fs->root) | 155 | if (! current->fs->root) |
155 | return; | 156 | return; |
156 | 157 | ||
157 | down(&ops_mutex); | 158 | mutex_lock(&ops_mutex); |
158 | list_for_each(head, &opslist) { | 159 | list_for_each(head, &opslist) { |
159 | struct ops_list *ops = list_entry(head, struct ops_list, list); | 160 | struct ops_list *ops = list_entry(head, struct ops_list, list); |
160 | if (! (ops->driver & DRIVER_LOADED) && | 161 | if (! (ops->driver & DRIVER_LOADED) && |
161 | ! (ops->driver & DRIVER_REQUESTED)) { | 162 | ! (ops->driver & DRIVER_REQUESTED)) { |
162 | ops->used++; | 163 | ops->used++; |
163 | up(&ops_mutex); | 164 | mutex_unlock(&ops_mutex); |
164 | ops->driver |= DRIVER_REQUESTED; | 165 | ops->driver |= DRIVER_REQUESTED; |
165 | request_module("snd-%s", ops->id); | 166 | request_module("snd-%s", ops->id); |
166 | down(&ops_mutex); | 167 | mutex_lock(&ops_mutex); |
167 | ops->used--; | 168 | ops->used--; |
168 | } | 169 | } |
169 | } | 170 | } |
170 | up(&ops_mutex); | 171 | mutex_unlock(&ops_mutex); |
171 | #endif | 172 | #endif |
172 | } | 173 | } |
173 | 174 | ||
@@ -214,10 +215,10 @@ int snd_seq_device_new(struct snd_card *card, int device, char *id, int argsize, | |||
214 | dev->status = SNDRV_SEQ_DEVICE_FREE; | 215 | dev->status = SNDRV_SEQ_DEVICE_FREE; |
215 | 216 | ||
216 | /* add this device to the list */ | 217 | /* add this device to the list */ |
217 | down(&ops->reg_mutex); | 218 | mutex_lock(&ops->reg_mutex); |
218 | list_add_tail(&dev->list, &ops->dev_list); | 219 | list_add_tail(&dev->list, &ops->dev_list); |
219 | ops->num_devices++; | 220 | ops->num_devices++; |
220 | up(&ops->reg_mutex); | 221 | mutex_unlock(&ops->reg_mutex); |
221 | 222 | ||
222 | unlock_driver(ops); | 223 | unlock_driver(ops); |
223 | 224 | ||
@@ -246,10 +247,10 @@ static int snd_seq_device_free(struct snd_seq_device *dev) | |||
246 | return -ENXIO; | 247 | return -ENXIO; |
247 | 248 | ||
248 | /* remove the device from the list */ | 249 | /* remove the device from the list */ |
249 | down(&ops->reg_mutex); | 250 | mutex_lock(&ops->reg_mutex); |
250 | list_del(&dev->list); | 251 | list_del(&dev->list); |
251 | ops->num_devices--; | 252 | ops->num_devices--; |
252 | up(&ops->reg_mutex); | 253 | mutex_unlock(&ops->reg_mutex); |
253 | 254 | ||
254 | free_device(dev, ops); | 255 | free_device(dev, ops); |
255 | if (dev->private_free) | 256 | if (dev->private_free) |
@@ -344,7 +345,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, | |||
344 | return -EBUSY; | 345 | return -EBUSY; |
345 | } | 346 | } |
346 | 347 | ||
347 | down(&ops->reg_mutex); | 348 | mutex_lock(&ops->reg_mutex); |
348 | /* copy driver operators */ | 349 | /* copy driver operators */ |
349 | ops->ops = *entry; | 350 | ops->ops = *entry; |
350 | ops->driver |= DRIVER_LOADED; | 351 | ops->driver |= DRIVER_LOADED; |
@@ -355,7 +356,7 @@ int snd_seq_device_register_driver(char *id, struct snd_seq_dev_ops *entry, | |||
355 | struct snd_seq_device *dev = list_entry(head, struct snd_seq_device, list); | 356 | struct snd_seq_device *dev = list_entry(head, struct snd_seq_device, list); |
356 | init_device(dev, ops); | 357 | init_device(dev, ops); |
357 | } | 358 | } |
358 | up(&ops->reg_mutex); | 359 | mutex_unlock(&ops->reg_mutex); |
359 | 360 | ||
360 | unlock_driver(ops); | 361 | unlock_driver(ops); |
361 | snd_seq_autoload_unlock(); | 362 | snd_seq_autoload_unlock(); |
@@ -378,17 +379,17 @@ static struct ops_list * create_driver(char *id) | |||
378 | 379 | ||
379 | /* set up driver entry */ | 380 | /* set up driver entry */ |
380 | strlcpy(ops->id, id, sizeof(ops->id)); | 381 | strlcpy(ops->id, id, sizeof(ops->id)); |
381 | init_MUTEX(&ops->reg_mutex); | 382 | mutex_init(&ops->reg_mutex); |
382 | ops->driver = DRIVER_EMPTY; | 383 | ops->driver = DRIVER_EMPTY; |
383 | INIT_LIST_HEAD(&ops->dev_list); | 384 | INIT_LIST_HEAD(&ops->dev_list); |
384 | /* lock this instance */ | 385 | /* lock this instance */ |
385 | ops->used = 1; | 386 | ops->used = 1; |
386 | 387 | ||
387 | /* register driver entry */ | 388 | /* register driver entry */ |
388 | down(&ops_mutex); | 389 | mutex_lock(&ops_mutex); |
389 | list_add_tail(&ops->list, &opslist); | 390 | list_add_tail(&ops->list, &opslist); |
390 | num_ops++; | 391 | num_ops++; |
391 | up(&ops_mutex); | 392 | mutex_unlock(&ops_mutex); |
392 | 393 | ||
393 | return ops; | 394 | return ops; |
394 | } | 395 | } |
@@ -414,7 +415,7 @@ int snd_seq_device_unregister_driver(char *id) | |||
414 | } | 415 | } |
415 | 416 | ||
416 | /* close and release all devices associated with this driver */ | 417 | /* close and release all devices associated with this driver */ |
417 | down(&ops->reg_mutex); | 418 | mutex_lock(&ops->reg_mutex); |
418 | ops->driver |= DRIVER_LOCKED; /* do not remove this driver recursively */ | 419 | ops->driver |= DRIVER_LOCKED; /* do not remove this driver recursively */ |
419 | list_for_each(head, &ops->dev_list) { | 420 | list_for_each(head, &ops->dev_list) { |
420 | struct snd_seq_device *dev = list_entry(head, struct snd_seq_device, list); | 421 | struct snd_seq_device *dev = list_entry(head, struct snd_seq_device, list); |
@@ -425,7 +426,7 @@ int snd_seq_device_unregister_driver(char *id) | |||
425 | if (ops->num_init_devices > 0) | 426 | if (ops->num_init_devices > 0) |
426 | snd_printk(KERN_ERR "free_driver: init_devices > 0!! (%d)\n", | 427 | snd_printk(KERN_ERR "free_driver: init_devices > 0!! (%d)\n", |
427 | ops->num_init_devices); | 428 | ops->num_init_devices); |
428 | up(&ops->reg_mutex); | 429 | mutex_unlock(&ops->reg_mutex); |
429 | 430 | ||
430 | unlock_driver(ops); | 431 | unlock_driver(ops); |
431 | 432 | ||
@@ -443,7 +444,7 @@ static void remove_drivers(void) | |||
443 | { | 444 | { |
444 | struct list_head *head; | 445 | struct list_head *head; |
445 | 446 | ||
446 | down(&ops_mutex); | 447 | mutex_lock(&ops_mutex); |
447 | head = opslist.next; | 448 | head = opslist.next; |
448 | while (head != &opslist) { | 449 | while (head != &opslist) { |
449 | struct ops_list *ops = list_entry(head, struct ops_list, list); | 450 | struct ops_list *ops = list_entry(head, struct ops_list, list); |
@@ -456,7 +457,7 @@ static void remove_drivers(void) | |||
456 | } else | 457 | } else |
457 | head = head->next; | 458 | head = head->next; |
458 | } | 459 | } |
459 | up(&ops_mutex); | 460 | mutex_unlock(&ops_mutex); |
460 | } | 461 | } |
461 | 462 | ||
462 | /* | 463 | /* |
@@ -519,16 +520,16 @@ static struct ops_list * find_driver(char *id, int create_if_empty) | |||
519 | { | 520 | { |
520 | struct list_head *head; | 521 | struct list_head *head; |
521 | 522 | ||
522 | down(&ops_mutex); | 523 | mutex_lock(&ops_mutex); |
523 | list_for_each(head, &opslist) { | 524 | list_for_each(head, &opslist) { |
524 | struct ops_list *ops = list_entry(head, struct ops_list, list); | 525 | struct ops_list *ops = list_entry(head, struct ops_list, list); |
525 | if (strcmp(ops->id, id) == 0) { | 526 | if (strcmp(ops->id, id) == 0) { |
526 | ops->used++; | 527 | ops->used++; |
527 | up(&ops_mutex); | 528 | mutex_unlock(&ops_mutex); |
528 | return ops; | 529 | return ops; |
529 | } | 530 | } |
530 | } | 531 | } |
531 | up(&ops_mutex); | 532 | mutex_unlock(&ops_mutex); |
532 | if (create_if_empty) | 533 | if (create_if_empty) |
533 | return create_driver(id); | 534 | return create_driver(id); |
534 | return NULL; | 535 | return NULL; |
@@ -536,9 +537,9 @@ static struct ops_list * find_driver(char *id, int create_if_empty) | |||
536 | 537 | ||
537 | static void unlock_driver(struct ops_list *ops) | 538 | static void unlock_driver(struct ops_list *ops) |
538 | { | 539 | { |
539 | down(&ops_mutex); | 540 | mutex_lock(&ops_mutex); |
540 | ops->used--; | 541 | ops->used--; |
541 | up(&ops_mutex); | 542 | mutex_unlock(&ops_mutex); |
542 | } | 543 | } |
543 | 544 | ||
544 | 545 | ||
diff --git a/sound/core/seq/seq_instr.c b/sound/core/seq/seq_instr.c index 487452063965..f30d171b6d96 100644 --- a/sound/core/seq/seq_instr.c +++ b/sound/core/seq/seq_instr.c | |||
@@ -36,7 +36,7 @@ static void snd_instr_lock_ops(struct snd_seq_kinstr_list *list) | |||
36 | if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) { | 36 | if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) { |
37 | spin_lock_irqsave(&list->ops_lock, list->ops_flags); | 37 | spin_lock_irqsave(&list->ops_lock, list->ops_flags); |
38 | } else { | 38 | } else { |
39 | down(&list->ops_mutex); | 39 | mutex_lock(&list->ops_mutex); |
40 | } | 40 | } |
41 | } | 41 | } |
42 | 42 | ||
@@ -45,7 +45,7 @@ static void snd_instr_unlock_ops(struct snd_seq_kinstr_list *list) | |||
45 | if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) { | 45 | if (!(list->flags & SNDRV_SEQ_INSTR_FLG_DIRECT)) { |
46 | spin_unlock_irqrestore(&list->ops_lock, list->ops_flags); | 46 | spin_unlock_irqrestore(&list->ops_lock, list->ops_flags); |
47 | } else { | 47 | } else { |
48 | up(&list->ops_mutex); | 48 | mutex_unlock(&list->ops_mutex); |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
@@ -82,7 +82,7 @@ struct snd_seq_kinstr_list *snd_seq_instr_list_new(void) | |||
82 | return NULL; | 82 | return NULL; |
83 | spin_lock_init(&list->lock); | 83 | spin_lock_init(&list->lock); |
84 | spin_lock_init(&list->ops_lock); | 84 | spin_lock_init(&list->ops_lock); |
85 | init_MUTEX(&list->ops_mutex); | 85 | mutex_init(&list->ops_mutex); |
86 | list->owner = -1; | 86 | list->owner = -1; |
87 | return list; | 87 | return list; |
88 | } | 88 | } |
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c index ce0df86157de..9caa1372bece 100644 --- a/sound/core/seq/seq_midi.c +++ b/sound/core/seq/seq_midi.c | |||
@@ -32,7 +32,7 @@ Possible options for midisynth module: | |||
32 | #include <linux/errno.h> | 32 | #include <linux/errno.h> |
33 | #include <linux/string.h> | 33 | #include <linux/string.h> |
34 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
35 | #include <asm/semaphore.h> | 35 | #include <linux/mutex.h> |
36 | #include <sound/core.h> | 36 | #include <sound/core.h> |
37 | #include <sound/rawmidi.h> | 37 | #include <sound/rawmidi.h> |
38 | #include <sound/seq_kernel.h> | 38 | #include <sound/seq_kernel.h> |
@@ -70,7 +70,7 @@ struct seq_midisynth_client { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | static struct seq_midisynth_client *synths[SNDRV_CARDS]; | 72 | static struct seq_midisynth_client *synths[SNDRV_CARDS]; |
73 | static DECLARE_MUTEX(register_mutex); | 73 | static DEFINE_MUTEX(register_mutex); |
74 | 74 | ||
75 | /* handle rawmidi input event (MIDI v1.0 stream) */ | 75 | /* handle rawmidi input event (MIDI v1.0 stream) */ |
76 | static void snd_midi_input_event(struct snd_rawmidi_substream *substream) | 76 | static void snd_midi_input_event(struct snd_rawmidi_substream *substream) |
@@ -308,13 +308,13 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) | |||
308 | if (ports > (256 / SNDRV_RAWMIDI_DEVICES)) | 308 | if (ports > (256 / SNDRV_RAWMIDI_DEVICES)) |
309 | ports = 256 / SNDRV_RAWMIDI_DEVICES; | 309 | ports = 256 / SNDRV_RAWMIDI_DEVICES; |
310 | 310 | ||
311 | down(®ister_mutex); | 311 | mutex_lock(®ister_mutex); |
312 | client = synths[card->number]; | 312 | client = synths[card->number]; |
313 | if (client == NULL) { | 313 | if (client == NULL) { |
314 | newclient = 1; | 314 | newclient = 1; |
315 | client = kzalloc(sizeof(*client), GFP_KERNEL); | 315 | client = kzalloc(sizeof(*client), GFP_KERNEL); |
316 | if (client == NULL) { | 316 | if (client == NULL) { |
317 | up(®ister_mutex); | 317 | mutex_unlock(®ister_mutex); |
318 | kfree(info); | 318 | kfree(info); |
319 | return -ENOMEM; | 319 | return -ENOMEM; |
320 | } | 320 | } |
@@ -324,7 +324,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) | |||
324 | (const char *)info->name : "External MIDI"); | 324 | (const char *)info->name : "External MIDI"); |
325 | if (client->seq_client < 0) { | 325 | if (client->seq_client < 0) { |
326 | kfree(client); | 326 | kfree(client); |
327 | up(®ister_mutex); | 327 | mutex_unlock(®ister_mutex); |
328 | kfree(info); | 328 | kfree(info); |
329 | return -ENOMEM; | 329 | return -ENOMEM; |
330 | } | 330 | } |
@@ -397,7 +397,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) | |||
397 | client->num_ports++; | 397 | client->num_ports++; |
398 | if (newclient) | 398 | if (newclient) |
399 | synths[card->number] = client; | 399 | synths[card->number] = client; |
400 | up(®ister_mutex); | 400 | mutex_unlock(®ister_mutex); |
401 | kfree(info); | 401 | kfree(info); |
402 | kfree(port); | 402 | kfree(port); |
403 | return 0; /* success */ | 403 | return 0; /* success */ |
@@ -414,7 +414,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) | |||
414 | } | 414 | } |
415 | kfree(info); | 415 | kfree(info); |
416 | kfree(port); | 416 | kfree(port); |
417 | up(®ister_mutex); | 417 | mutex_unlock(®ister_mutex); |
418 | return -ENOMEM; | 418 | return -ENOMEM; |
419 | } | 419 | } |
420 | 420 | ||
@@ -427,10 +427,10 @@ snd_seq_midisynth_unregister_port(struct snd_seq_device *dev) | |||
427 | struct snd_card *card = dev->card; | 427 | struct snd_card *card = dev->card; |
428 | int device = dev->device, p, ports; | 428 | int device = dev->device, p, ports; |
429 | 429 | ||
430 | down(®ister_mutex); | 430 | mutex_lock(®ister_mutex); |
431 | client = synths[card->number]; | 431 | client = synths[card->number]; |
432 | if (client == NULL || client->ports[device] == NULL) { | 432 | if (client == NULL || client->ports[device] == NULL) { |
433 | up(®ister_mutex); | 433 | mutex_unlock(®ister_mutex); |
434 | return -ENODEV; | 434 | return -ENODEV; |
435 | } | 435 | } |
436 | ports = client->ports_per_device[device]; | 436 | ports = client->ports_per_device[device]; |
@@ -446,7 +446,7 @@ snd_seq_midisynth_unregister_port(struct snd_seq_device *dev) | |||
446 | synths[card->number] = NULL; | 446 | synths[card->number] = NULL; |
447 | kfree(client); | 447 | kfree(client); |
448 | } | 448 | } |
449 | up(®ister_mutex); | 449 | mutex_unlock(®ister_mutex); |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | 452 | ||
diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 2b384fd7967f..41e078c938cd 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c | |||
@@ -159,7 +159,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, | |||
159 | port_subs_info_init(&new_port->c_dest); | 159 | port_subs_info_init(&new_port->c_dest); |
160 | 160 | ||
161 | num = port >= 0 ? port : 0; | 161 | num = port >= 0 ? port : 0; |
162 | down(&client->ports_mutex); | 162 | mutex_lock(&client->ports_mutex); |
163 | write_lock_irqsave(&client->ports_lock, flags); | 163 | write_lock_irqsave(&client->ports_lock, flags); |
164 | list_for_each(l, &client->ports_list_head) { | 164 | list_for_each(l, &client->ports_list_head) { |
165 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); | 165 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); |
@@ -173,7 +173,7 @@ struct snd_seq_client_port *snd_seq_create_port(struct snd_seq_client *client, | |||
173 | client->num_ports++; | 173 | client->num_ports++; |
174 | new_port->addr.port = num; /* store the port number in the port */ | 174 | new_port->addr.port = num; /* store the port number in the port */ |
175 | write_unlock_irqrestore(&client->ports_lock, flags); | 175 | write_unlock_irqrestore(&client->ports_lock, flags); |
176 | up(&client->ports_mutex); | 176 | mutex_unlock(&client->ports_mutex); |
177 | sprintf(new_port->name, "port-%d", num); | 177 | sprintf(new_port->name, "port-%d", num); |
178 | 178 | ||
179 | return new_port; | 179 | return new_port; |
@@ -292,7 +292,7 @@ int snd_seq_delete_port(struct snd_seq_client *client, int port) | |||
292 | struct list_head *l; | 292 | struct list_head *l; |
293 | struct snd_seq_client_port *found = NULL; | 293 | struct snd_seq_client_port *found = NULL; |
294 | 294 | ||
295 | down(&client->ports_mutex); | 295 | mutex_lock(&client->ports_mutex); |
296 | write_lock_irqsave(&client->ports_lock, flags); | 296 | write_lock_irqsave(&client->ports_lock, flags); |
297 | list_for_each(l, &client->ports_list_head) { | 297 | list_for_each(l, &client->ports_list_head) { |
298 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); | 298 | struct snd_seq_client_port *p = list_entry(l, struct snd_seq_client_port, list); |
@@ -305,7 +305,7 @@ int snd_seq_delete_port(struct snd_seq_client *client, int port) | |||
305 | } | 305 | } |
306 | } | 306 | } |
307 | write_unlock_irqrestore(&client->ports_lock, flags); | 307 | write_unlock_irqrestore(&client->ports_lock, flags); |
308 | up(&client->ports_mutex); | 308 | mutex_unlock(&client->ports_mutex); |
309 | if (found) | 309 | if (found) |
310 | return port_delete(client, found); | 310 | return port_delete(client, found); |
311 | else | 311 | else |
@@ -321,7 +321,7 @@ int snd_seq_delete_all_ports(struct snd_seq_client *client) | |||
321 | /* move the port list to deleted_list, and | 321 | /* move the port list to deleted_list, and |
322 | * clear the port list in the client data. | 322 | * clear the port list in the client data. |
323 | */ | 323 | */ |
324 | down(&client->ports_mutex); | 324 | mutex_lock(&client->ports_mutex); |
325 | write_lock_irqsave(&client->ports_lock, flags); | 325 | write_lock_irqsave(&client->ports_lock, flags); |
326 | if (! list_empty(&client->ports_list_head)) { | 326 | if (! list_empty(&client->ports_list_head)) { |
327 | __list_add(&deleted_list, | 327 | __list_add(&deleted_list, |
@@ -341,7 +341,7 @@ int snd_seq_delete_all_ports(struct snd_seq_client *client) | |||
341 | snd_seq_system_client_ev_port_exit(port->addr.client, port->addr.port); | 341 | snd_seq_system_client_ev_port_exit(port->addr.client, port->addr.port); |
342 | port_delete(client, port); | 342 | port_delete(client, port); |
343 | } | 343 | } |
344 | up(&client->ports_mutex); | 344 | mutex_unlock(&client->ports_mutex); |
345 | return 0; | 345 | return 0; |
346 | } | 346 | } |
347 | 347 | ||
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c index 9cf20f045542..9b87bb0c7f33 100644 --- a/sound/core/seq/seq_queue.c +++ b/sound/core/seq/seq_queue.c | |||
@@ -119,7 +119,7 @@ static struct snd_seq_queue *queue_new(int owner, int locked) | |||
119 | 119 | ||
120 | spin_lock_init(&q->owner_lock); | 120 | spin_lock_init(&q->owner_lock); |
121 | spin_lock_init(&q->check_lock); | 121 | spin_lock_init(&q->check_lock); |
122 | init_MUTEX(&q->timer_mutex); | 122 | mutex_init(&q->timer_mutex); |
123 | snd_use_lock_init(&q->use_lock); | 123 | snd_use_lock_init(&q->use_lock); |
124 | q->queue = -1; | 124 | q->queue = -1; |
125 | 125 | ||
@@ -516,7 +516,7 @@ int snd_seq_queue_use(int queueid, int client, int use) | |||
516 | queue = queueptr(queueid); | 516 | queue = queueptr(queueid); |
517 | if (queue == NULL) | 517 | if (queue == NULL) |
518 | return -EINVAL; | 518 | return -EINVAL; |
519 | down(&queue->timer_mutex); | 519 | mutex_lock(&queue->timer_mutex); |
520 | if (use) { | 520 | if (use) { |
521 | if (!test_and_set_bit(client, queue->clients_bitmap)) | 521 | if (!test_and_set_bit(client, queue->clients_bitmap)) |
522 | queue->clients++; | 522 | queue->clients++; |
@@ -531,7 +531,7 @@ int snd_seq_queue_use(int queueid, int client, int use) | |||
531 | } else { | 531 | } else { |
532 | snd_seq_timer_close(queue); | 532 | snd_seq_timer_close(queue); |
533 | } | 533 | } |
534 | up(&queue->timer_mutex); | 534 | mutex_unlock(&queue->timer_mutex); |
535 | queuefree(queue); | 535 | queuefree(queue); |
536 | return 0; | 536 | return 0; |
537 | } | 537 | } |
diff --git a/sound/core/seq/seq_queue.h b/sound/core/seq/seq_queue.h index 888438599387..30c8111477f6 100644 --- a/sound/core/seq/seq_queue.h +++ b/sound/core/seq/seq_queue.h | |||
@@ -54,7 +54,7 @@ struct snd_seq_queue { | |||
54 | /* clients which uses this queue (bitmap) */ | 54 | /* clients which uses this queue (bitmap) */ |
55 | DECLARE_BITMAP(clients_bitmap, SNDRV_SEQ_MAX_CLIENTS); | 55 | DECLARE_BITMAP(clients_bitmap, SNDRV_SEQ_MAX_CLIENTS); |
56 | unsigned int clients; /* users of this queue */ | 56 | unsigned int clients; /* users of this queue */ |
57 | struct semaphore timer_mutex; | 57 | struct mutex timer_mutex; |
58 | 58 | ||
59 | snd_use_lock_t use_lock; | 59 | snd_use_lock_t use_lock; |
60 | }; | 60 | }; |