diff options
Diffstat (limited to 'sound/core/seq/seq_midi.c')
-rw-r--r-- | sound/core/seq/seq_midi.c | 20 |
1 files changed, 10 insertions, 10 deletions
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 | ||