Skip to content
Unverified Commit 67ad8777 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: soc-pcm: check DAI's activity more simply



soc_pcm_hw_free() want to call snd_soc_dai_digital_mute()
if it was last user of Playback or Capture.

	bool playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
	int playback_active = dai->stream_active[SNDRV_PCM_STREAM_PLAYBACK];
	int capture_active  = dai->stream_active[SNDRV_PCM_STREAM_CAPTURE];

	if ((playback  && playback_active == 1) ||
	    (!playback && capture_active  == 1))
		snd_soc_dai_digital_mute(...)

But it is same as

	int active = dai->stream_active[substream->stream];

	if (active == 1)
		snd_soc_dai_digital_mute(...)

This patch simplify the code.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87k13yp9ub.wl-kuninori.morimoto.gx@renesas.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8a01fbf0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment