summaryrefslogtreecommitdiff
path: root/sound/pci/emu10k1/voice.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/emu10k1/voice.c')
-rw-r--r--sound/pci/emu10k1/voice.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index 77fb5427aaed..7fe1d1727768 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -77,7 +77,6 @@ static void voice_free(struct snd_emu10k1 *emu,
int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int count, int channels,
struct snd_emu10k1_pcm *epcm, struct snd_emu10k1_voice **rvoice)
{
- unsigned long flags;
int result;
if (snd_BUG_ON(!rvoice))
@@ -87,7 +86,7 @@ int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int count, int ch
if (snd_BUG_ON(!channels))
return -EINVAL;
- spin_lock_irqsave(&emu->voice_lock, flags);
+ guard(spinlock_irqsave)(&emu->voice_lock);
for (int got = 0; got < channels; ) {
result = voice_alloc(emu, type, count, epcm, &rvoice[got]);
if (result == 0) {
@@ -113,7 +112,6 @@ int snd_emu10k1_voice_alloc(struct snd_emu10k1 *emu, int type, int count, int ch
}
break;
}
- spin_unlock_irqrestore(&emu->voice_lock, flags);
return result;
}
@@ -123,17 +121,15 @@ EXPORT_SYMBOL(snd_emu10k1_voice_alloc);
int snd_emu10k1_voice_free(struct snd_emu10k1 *emu,
struct snd_emu10k1_voice *pvoice)
{
- unsigned long flags;
int last;
if (snd_BUG_ON(!pvoice))
return -EINVAL;
- spin_lock_irqsave(&emu->voice_lock, flags);
+ guard(spinlock_irqsave)(&emu->voice_lock);
do {
last = pvoice->last;
voice_free(emu, pvoice++);
} while (!last);
- spin_unlock_irqrestore(&emu->voice_lock, flags);
return 0;
}