summaryrefslogtreecommitdiffstats
path: root/drivers/sound/sb_midi.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /drivers/sound/sb_midi.c
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'drivers/sound/sb_midi.c')
-rw-r--r--drivers/sound/sb_midi.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/sound/sb_midi.c b/drivers/sound/sb_midi.c
index f5f6e3d6c..bcfa3b3f1 100644
--- a/drivers/sound/sb_midi.c
+++ b/drivers/sound/sb_midi.c
@@ -11,6 +11,8 @@
* for more info.
*/
+#include <linux/spinlock.h>
+
#include "sound_config.h"
#include "sb.h"
@@ -36,15 +38,14 @@ static int sb_midi_open(int dev, int mode,
if (devc == NULL)
return -ENXIO;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&devc->lock, flags);
if (devc->opened)
{
- restore_flags(flags);
+ spin_unlock_irqrestore(&devc->lock, flags);
return -EBUSY;
}
devc->opened = 1;
- restore_flags(flags);
+ spin_unlock_irqrestore(&devc->lock, flags);
devc->irq_mode = IMODE_MIDI;
devc->midi_broken = 0;
@@ -74,13 +75,12 @@ static void sb_midi_close(int dev)
if (devc == NULL)
return;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&devc->lock, flags);
sb_dsp_reset(devc);
devc->intr_active = 0;
devc->input_opened = 0;
devc->opened = 0;
- restore_flags(flags);
+ spin_unlock_irqrestore(&devc->lock, flags);
}
static int sb_midi_out(int dev, unsigned char midi_byte)
@@ -131,14 +131,13 @@ void sb_midi_interrupt(sb_devc * devc)
if (devc == NULL)
return;
- save_flags(flags);
- cli();
+ spin_lock_irqsave(&devc->lock, flags);
data = inb(DSP_READ);
if (devc->input_opened)
devc->midi_input_intr(devc->my_mididev, data);
- restore_flags(flags);
+ spin_unlock_irqrestore(&devc->lock, flags);
}
#define MIDI_SYNTH_NAME "Sound Blaster Midi"