summaryrefslogtreecommitdiff
path: root/sound/firewire/dice/dice-stream.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/firewire/dice/dice-stream.c')
-rw-r--r--sound/firewire/dice/dice-stream.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c
index 4c677c8546c7..d5ffe7c82993 100644
--- a/sound/firewire/dice/dice-stream.c
+++ b/sound/firewire/dice/dice-stream.c
@@ -677,32 +677,23 @@ static void dice_lock_changed(struct snd_dice *dice)
int snd_dice_stream_lock_try(struct snd_dice *dice)
{
- int err;
-
- spin_lock_irq(&dice->lock);
+ guard(spinlock_irq)(&dice->lock);
- if (dice->dev_lock_count < 0) {
- err = -EBUSY;
- goto out;
- }
+ if (dice->dev_lock_count < 0)
+ return -EBUSY;
if (dice->dev_lock_count++ == 0)
dice_lock_changed(dice);
- err = 0;
-out:
- spin_unlock_irq(&dice->lock);
- return err;
+ return 0;
}
void snd_dice_stream_lock_release(struct snd_dice *dice)
{
- spin_lock_irq(&dice->lock);
+ guard(spinlock_irq)(&dice->lock);
if (WARN_ON(dice->dev_lock_count <= 0))
- goto out;
+ return;
if (--dice->dev_lock_count == 0)
dice_lock_changed(dice);
-out:
- spin_unlock_irq(&dice->lock);
}