diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-31 15:34:58 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-03-31 15:34:58 -0500 |
commit | 86579dd06deecfa6ac88d5e84e4d63c397cd6f6d (patch) | |
tree | b4475d3ccde53015ad84a06e4e55e64591171b75 /sound/core/seq/seq_midi.c | |
parent | 7ea9ea832212c4a755650f7c7cc1ff0b63292a41 (diff) | |
parent | a0f067802576d4eb4c65d40b8ee7d6ea3c81dd61 (diff) |
Merge branch 'master'
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: #include <linux/errno.h> #include <linux/string.h> #include <linux/moduleparam.h> -#include <asm/semaphore.h> +#include <linux/mutex.h> #include <sound/core.h> #include <sound/rawmidi.h> #include <sound/seq_kernel.h> @@ -70,7 +70,7 @@ struct seq_midisynth_client { }; static struct seq_midisynth_client *synths[SNDRV_CARDS]; -static DECLARE_MUTEX(register_mutex); +static DEFINE_MUTEX(register_mutex); /* handle rawmidi input event (MIDI v1.0 stream) */ 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) if (ports > (256 / SNDRV_RAWMIDI_DEVICES)) ports = 256 / SNDRV_RAWMIDI_DEVICES; - down(®ister_mutex); + mutex_lock(®ister_mutex); client = synths[card->number]; if (client == NULL) { newclient = 1; client = kzalloc(sizeof(*client), GFP_KERNEL); if (client == NULL) { - up(®ister_mutex); + mutex_unlock(®ister_mutex); kfree(info); return -ENOMEM; } @@ -324,7 +324,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) (const char *)info->name : "External MIDI"); if (client->seq_client < 0) { kfree(client); - up(®ister_mutex); + mutex_unlock(®ister_mutex); kfree(info); return -ENOMEM; } @@ -397,7 +397,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) client->num_ports++; if (newclient) synths[card->number] = client; - up(®ister_mutex); + mutex_unlock(®ister_mutex); kfree(info); kfree(port); return 0; /* success */ @@ -414,7 +414,7 @@ snd_seq_midisynth_register_port(struct snd_seq_device *dev) } kfree(info); kfree(port); - up(®ister_mutex); + mutex_unlock(®ister_mutex); return -ENOMEM; } @@ -427,10 +427,10 @@ snd_seq_midisynth_unregister_port(struct snd_seq_device *dev) struct snd_card *card = dev->card; int device = dev->device, p, ports; - down(®ister_mutex); + mutex_lock(®ister_mutex); client = synths[card->number]; if (client == NULL || client->ports[device] == NULL) { - up(®ister_mutex); + mutex_unlock(®ister_mutex); return -ENODEV; } ports = client->ports_per_device[device]; @@ -446,7 +446,7 @@ snd_seq_midisynth_unregister_port(struct snd_seq_device *dev) synths[card->number] = NULL; kfree(client); } - up(®ister_mutex); + mutex_unlock(®ister_mutex); return 0; } |