diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-11-07 19:08:28 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-11-09 20:20:40 +0300 |
commit | 1fb8510cdb5b7befe8a59f533c7fc12ef0dac73e (patch) | |
tree | b44569425ea7683d02893cfd145081a11d7677f1 /sound/soc/atmel/atmel-pcm-dma.c | |
parent | 31584ed18c073176a7ad96ddbfd09765e21e813d (diff) | |
download | linux-1fb8510cdb5b7befe8a59f533c7fc12ef0dac73e.tar.xz |
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 <tiwai@suse.de>
Diffstat (limited to 'sound/soc/atmel/atmel-pcm-dma.c')
-rw-r--r-- | sound/soc/atmel/atmel-pcm-dma.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/atmel/atmel-pcm-dma.c b/sound/soc/atmel/atmel-pcm-dma.c index b79a2a864513..33fb3bb133df 100644 --- a/sound/soc/atmel/atmel-pcm-dma.c +++ b/sound/soc/atmel/atmel-pcm-dma.c @@ -80,9 +80,7 @@ static void atmel_pcm_dma_irq(u32 ssc_sr, /* stop RX and capture: will be enabled again at restart */ ssc_writex(prtd->ssc->regs, SSC_CR, prtd->mask->ssc_disable); - snd_pcm_stream_lock(substream); - snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN); - snd_pcm_stream_unlock(substream); + snd_pcm_stop_xrun(substream); /* now drain RHR and read status to remove xrun condition */ ssc_readx(prtd->ssc->regs, SSC_RHR); |