diff mbox series

[05/20] ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()

Message ID 87v8gqp4ww.wl-kuninori.morimoto.gx@renesas.com
State Superseded
Headers show
Series ASoC: replace dpcm_playback/capture to playback/capture_only | expand

Commit Message

Kuninori Morimoto May 18, 2023, 5:47 a.m. UTC
soc_get_playback_capture() (A) returns number of substreams for
playback/capture, and then, we can use playback/capture_only flag (X)(Y).

(A)     static int soc_get_playback_capture(...)
	{
		...
(X)		if (dai_link->playback_only) {
(*)			*playback = 1;
			*capture = 0;
		}

(Y)		if (dai_link->capture_only) {
			*playback = 0;
(*)			*capture = 1;
		}
		...
	}

But this flag should not have effect to opposite side stream (*).
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-pcm.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index c127ab9de61f..89416c127dca 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2807,15 +2807,11 @@  static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd,
 		}
 	}
 
-	if (dai_link->playback_only) {
-		tmp_playback = 1;
+	if (dai_link->playback_only)
 		tmp_capture = 0;
-	}
 
-	if (dai_link->capture_only) {
+	if (dai_link->capture_only)
 		tmp_playback = 0;
-		tmp_capture = 1;
-	}
 
 	if (!tmp_playback && !tmp_capture) {
 		dev_err(rtd->dev, "substream %s has no playback, no capture\n",