mirror of https://github.com/torvalds/linux.git
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
This commit is contained in:
parent
18aec9ea32
commit
e25667d3f3
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue