diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2023-05-30 02:50:08 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-05-31 13:25:06 +0200 |
commit | e1f653ce847bab7285dd135cabe3ce544e574c75 (patch) | |
tree | cd8e9df5984c461b719a2d11aa7062765d798de4 /sound/soc/soc-pcm.c | |
parent | ASoC: soc-pcm.c: use temporary variable at soc_get_playback_capture() (diff) | |
download | linux-e1f653ce847bab7285dd135cabe3ce544e574c75.tar.xz linux-e1f653ce847bab7285dd135cabe3ce544e574c75.zip |
ASoC: soc-pcm.c: tidyup playback/capture_only at soc_get_playback_capture()
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>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87sfbezlq8.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index 765e43ca637d..fc0817dd0d83 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -2806,15 +2806,11 @@ static int soc_get_playback_capture(struct snd_soc_pcm_runtime *rtd, } } - if (dai_link->playback_only) { - has_playback = 1; + if (dai_link->playback_only) has_capture = 0; - } - if (dai_link->capture_only) { + if (dai_link->capture_only) has_playback = 0; - has_capture = 1; - } if (!has_playback && !has_capture) { dev_err(rtd->dev, "substream %s has no playback, no capture\n", |