From: Kuninori Morimoto Date: Mon, 18 Oct 2021 02:05:05 +0000 (+0900) Subject: ASoC: soc-pcm: tidyup soc_pcm_hw_clean() - step2 X-Git-Tag: v5.16-rc3~45^2~4^2~83^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86e4aef6c9a113374f69c6dc63877e10935926a7;p=thirdparty%2Fkernel%2Flinux.git ASoC: soc-pcm: tidyup soc_pcm_hw_clean() - step2 DAI active count is not exchanged during for_each_rtd_dais() loops. We don't need to keep snd_soc_dai_stream_active() as "active" on soc_pcm_hw_clean(). This patch avoid verbose code. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87ilxvt7e6.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index ee8071cbc9524..4d41ad3028029 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -879,12 +879,10 @@ static int soc_pcm_hw_clean(struct snd_pcm_substream *substream, int rollback) /* clear the corresponding DAIs parameters when going to be inactive */ for_each_rtd_dais(rtd, i, dai) { - int active = snd_soc_dai_stream_active(dai, substream->stream); - if (snd_soc_dai_active(dai) == 1) soc_pcm_set_dai_params(dai, NULL); - if (active == 1) + if (snd_soc_dai_stream_active(dai, substream->stream) == 1) snd_soc_dai_digital_mute(dai, 1, substream->stream); }