From 1fb8510cdb5b7befe8a59f533c7fc12ef0dac73e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 7 Nov 2014 17:08:28 +0100 Subject: ALSA: pcm: Add snd_pcm_stop_xrun() helper Add a new helper function snd_pcm_stop_xrun() to the standard sequnce lock/snd_pcm_stop(XRUN)/unlock by a single call, and replace the existing open codes with this helper. The function checks the PCM running state to prevent setting the wrong state, too, for more safety. Signed-off-by: Takashi Iwai --- drivers/media/pci/saa7134/saa7134-alsa.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/pci/saa7134/saa7134-alsa.c b/drivers/media/pci/saa7134/saa7134-alsa.c index 40569894c1c9..ac3cd74e824e 100644 --- a/drivers/media/pci/saa7134/saa7134-alsa.c +++ b/drivers/media/pci/saa7134/saa7134-alsa.c @@ -173,9 +173,7 @@ static void saa7134_irq_alsa_done(struct saa7134_dev *dev, dprintk("irq: overrun [full=%d/%d] - Blocks in %d\n",dev->dmasound.read_count, dev->dmasound.bufsize, dev->dmasound.blocks); spin_unlock(&dev->slock); - snd_pcm_stream_lock(dev->dmasound.substream); - snd_pcm_stop(dev->dmasound.substream,SNDRV_PCM_STATE_XRUN); - snd_pcm_stream_unlock(dev->dmasound.substream); + snd_pcm_stop_xrun(dev->dmasound.substream); return; } -- cgit v1.2.3