Skip to content

Commit

Permalink
ASoC: davinci: Use snd_pcm_stop_xrun() helper
Browse files Browse the repository at this point in the history
Replace open-codes with the standard snd_pcm_stop_xrun() helper.
It simplifies codes a lot.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Takashi Iwai authored and Mark Brown committed Jul 4, 2018
1 parent da13ed1 commit dae35d1
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions sound/soc/davinci/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,8 @@ static irqreturn_t davinci_mcasp_tx_irq_handler(int irq, void *data)
handled_mask |= XUNDRN;

substream = mcasp->substreams[SNDRV_PCM_STREAM_PLAYBACK];
if (substream) {
snd_pcm_stream_lock_irq(substream);
if (snd_pcm_running(substream))
snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
snd_pcm_stream_unlock_irq(substream);
}
if (substream)
snd_pcm_stop_xrun(substream);
}

if (!handled_mask)
Expand Down Expand Up @@ -355,12 +351,8 @@ static irqreturn_t davinci_mcasp_rx_irq_handler(int irq, void *data)
handled_mask |= ROVRN;

substream = mcasp->substreams[SNDRV_PCM_STREAM_CAPTURE];
if (substream) {
snd_pcm_stream_lock_irq(substream);
if (snd_pcm_running(substream))
snd_pcm_stop(substream, SNDRV_PCM_STATE_XRUN);
snd_pcm_stream_unlock_irq(substream);
}
if (substream)
snd_pcm_stop_xrun(substream);
}

if (!handled_mask)
Expand Down

0 comments on commit dae35d1

Please sign in to comment.