diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-07-22 03:36:16 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-07-23 19:14:26 +0200 |
commit | 467fece8fbc6774a3a3bd0981e1a342fb5022706 (patch) | |
tree | d85ea1aa80bfba0bd132566567fc41a7e0d2ff4c /sound/soc/soc-compress.c | |
parent | ASoC: soc-core: use existing snd_soc_dai_digital_mute() (diff) | |
download | linux-467fece8fbc6774a3a3bd0981e1a342fb5022706.tar.xz linux-467fece8fbc6774a3a3bd0981e1a342fb5022706.zip |
ASoC: soc-dai: move snd_soc_dai_stream_valid() to soc-dai.c
snd_soc_dai_stream_valid() is function to check stream validity.
But, some code is using it, some code are checking stream->channels_min
directly. Doing samethings by different method is confusable.
This patch uses same funcntion for same purpose.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ftmyhmzz.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-compress.c')
-rw-r--r-- | sound/soc/soc-compress.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index ddef4ff677ce..289211069a1e 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -872,14 +872,13 @@ int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) } /* check client and interface hw capabilities */ - if (codec_dai->driver->playback.channels_min) + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) && + snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK)) playback = 1; - if (codec_dai->driver->capture.channels_min) + if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) && + snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE)) capture = 1; - capture = capture && cpu_dai->driver->capture.channels_min; - playback = playback && cpu_dai->driver->playback.channels_min; - /* * Compress devices are unidirectional so only one of the directions * should be set, check for that (xor) |