[alsa-devel] [PATCH 4/4] ASoC: stm32: Use snd_pcm_stop_xrun() helper
Takashi Iwai
tiwai at suse.de
Wed Jul 4 16:01:46 CEST 2018
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 at 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;
}
--
2.18.0
More information about the Alsa-devel
mailing list