ASoC: stm32: Use snd_pcm_stop_xrun() helper
authorTakashi Iwai <tiwai@suse.de>
Wed, 4 Jul 2018 14:01:46 +0000 (16:01 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 4 Jul 2018 14:41:36 +0000 (15:41 +0100)
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>
sound/soc/stm/stm32_sai_sub.c

index c4f15ea..06fba96 100644 (file)
@@ -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;
 }