diff options
author | Daniel Mack <daniel@zonque.org> | 2014-10-19 03:07:35 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-22 06:36:36 -0400 |
commit | 15f6b09a00a6d12b594c439fb3a7e2d113a05592 (patch) | |
tree | 9177e9aa51823aac6dd1b41bf0280e621ab334cf | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: soc-compress: consolidate two identical branches
The actions taken in both branches are identical, so we can simplify the
code. Spotted by Coverity.
Signed-off-by: Daniel Mack <daniel@zonque.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/soc-compress.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index cecfab3cc948..590a82f01d0b 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c | |||
@@ -258,10 +258,7 @@ static int soc_compr_free_fe(struct snd_compr_stream *cstream) | |||
258 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) | 258 | list_for_each_entry(dpcm, &fe->dpcm[stream].be_clients, list_be) |
259 | dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; | 259 | dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; |
260 | 260 | ||
261 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 261 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP); |
262 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP); | ||
263 | else | ||
264 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_STOP); | ||
265 | 262 | ||
266 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; | 263 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_CLOSE; |
267 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; | 264 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; |
@@ -456,11 +453,7 @@ static int soc_compr_set_params_fe(struct snd_compr_stream *cstream, | |||
456 | if (ret < 0) | 453 | if (ret < 0) |
457 | goto out; | 454 | goto out; |
458 | 455 | ||
459 | if (stream == SNDRV_PCM_STREAM_PLAYBACK) | 456 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START); |
460 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START); | ||
461 | else | ||
462 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_START); | ||
463 | |||
464 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; | 457 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_PREPARE; |
465 | 458 | ||
466 | out: | 459 | out: |