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 --- sound/soc/stm/stm32_sai_sub.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c index cfeb219e1d78..6fea8a684da2 100644 --- a/sound/soc/stm/stm32_sai_sub.c +++ b/sound/soc/stm/stm32_sai_sub.c @@ -259,11 +259,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; }