Skip to content

Commit

Permalink
ASoC: stm32: Use snd_pcm_stop_xrun() helper
Browse files Browse the repository at this point in the history
The XRUN trigger from the driver should be done via
snd_pcm_stop_xrun().  It simplifies the locking as well.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Jul 4, 2018
1 parent dc865fb commit b1625fb
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sound/soc/stm/stm32_sai_sub.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,8 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid)
status = SNDRV_PCM_STATE_XRUN;
}

if (status != SNDRV_PCM_STATE_RUNNING) {
snd_pcm_stream_lock(sai->substream);
snd_pcm_stop(sai->substream, SNDRV_PCM_STATE_XRUN);
snd_pcm_stream_unlock(sai->substream);
}
if (status != SNDRV_PCM_STATE_RUNNING)
snd_pcm_stop_xrun(sai->substream);

return IRQ_HANDLED;
}
Expand Down

0 comments on commit b1625fb

Please sign in to comment.