diff options
| author | Takashi Iwai <tiwai@suse.de> | 2025-08-29 16:43:15 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2025-09-01 13:52:41 +0200 |
| commit | e25667d3f311f7b56d4c4b7294a8c2a6f1cb69d7 (patch) | |
| tree | 123259b5953692fc7cbf662dca1329cd9f9183b1 /sound/pci | |
| parent | 18aec9ea320ffc3c66058c1da8f86c413c17ff43 (diff) | |
ALSA: lola: Use guard() for spin locks
Clean up the code using guard() for spin locks.
Merely code refactoring, and no behavior change.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20250829144342.4290-41-tiwai@suse.de
Diffstat (limited to 'sound/pci')
| -rw-r--r-- | sound/pci/lola/lola.c | 4 | ||||
| -rw-r--r-- | sound/pci/lola/lola_pcm.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 8d927ecba165..34a3ba17deb4 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c @@ -74,7 +74,6 @@ static int corb_send_verb(struct lola *chip, unsigned int nid, unsigned int verb, unsigned int data, unsigned int extdata) { - unsigned long flags; int ret = -EIO; chip->last_cmd_nid = nid; @@ -83,7 +82,7 @@ static int corb_send_verb(struct lola *chip, unsigned int nid, chip->last_extdata = extdata; data |= (nid << 20) | (verb << 8); - spin_lock_irqsave(&chip->reg_lock, flags); + guard(spinlock_irqsave)(&chip->reg_lock); if (chip->rirb.cmds < LOLA_CORB_ENTRIES - 1) { unsigned int wp = chip->corb.wp + 1; wp %= LOLA_CORB_ENTRIES; @@ -95,7 +94,6 @@ static int corb_send_verb(struct lola *chip, unsigned int nid, smp_wmb(); ret = 0; } - spin_unlock_irqrestore(&chip->reg_lock, flags); return ret; } diff --git a/sound/pci/lola/lola_pcm.c b/sound/pci/lola/lola_pcm.c index 35e919d240bf..6c046ecd6e08 100644 --- a/sound/pci/lola/lola_pcm.c +++ b/sound/pci/lola/lola_pcm.c @@ -523,7 +523,7 @@ static int lola_pcm_trigger(struct snd_pcm_substream *substream, int cmd) */ sync_streams = (start && snd_pcm_stream_linked(substream)); tstamp = lola_get_tstamp(chip, !sync_streams); - spin_lock(&chip->reg_lock); + guard(spinlock)(&chip->reg_lock); snd_pcm_group_for_each_entry(s, substream) { if (s->pcm->card != substream->pcm->card) continue; @@ -536,7 +536,6 @@ static int lola_pcm_trigger(struct snd_pcm_substream *substream, int cmd) str->paused = !start; snd_pcm_trigger_done(s, substream); } - spin_unlock(&chip->reg_lock); return 0; } |
