From c3adcde5560238fc49b7814023fb1445c7a09061 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Sun, 30 Aug 2020 18:59:11 +0100 Subject: [PATCH] v5.8: struct snd_soc_dai->active replaced by snd_soc_dai_active(snd_soc_dai) commit 0812a08ac8d054efc6cf2895d3b0e82c8731f8e9 Author: Kuninori Morimoto Date: Fri May 15 09:48:02 2020 +0900 ASoC: cleanup dai / component active code No one is using dai->active, snd_soc_component_is_active(). Let's remove these. commit efffd9b344adbf813e3ae6f6136df80000bf2833 Author: Kuninori Morimoto Date: Fri May 15 09:46:37 2020 +0900 ASoC: soc-dai: add snd_soc_dai_active() Current snd_soc_dai_action() is updating dai->stream_active for Playback/Capture (A), dai->active for DAI (B) void snd_soc_dai_action(struct snd_soc_dai *dai, int stream, int action) { (A) dai->stream_active[stream] += action; (B) dai->active += action; dai->component->active += action; } But, these are very verbose, because we can calculate DAI active from stream_active. This patch adds snd_soc_dai_active() which calculate DAI active from DAI stream_active. --- ac101.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ac101.c b/ac101.c index 26aa9e3..73720fc 100644 --- a/ac101.c +++ b/ac101.c @@ -956,9 +956,9 @@ void ac101_aif_shutdown(struct snd_pcm_substream *substream, struct snd_soc_dai AC101_DBG("stream = %s, play: %d, capt: %d, active: %d\n", snd_pcm_stream_str(substream), codec_dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK], codec_dai->stream_active[SNDRV_PCM_STREAM_CAPTURE], - codec_dai->active); + snd_soc_dai_active(codec_dai)); - if (!codec_dai->active) { + if (snd_soc_dai_active(codec_dai)) { ac10x->aif1_clken = 1; ac101_aif1clk(codec, SND_SOC_DAPM_POST_PMD, 0); } else {