From: Benoit Cousson Date: Tue, 8 Jul 2014 21:19:37 +0000 (+0200) Subject: ASoC: compress: Prevent multicodec for compressed stream X-Git-Tag: firefly_0821_release~176^2~3158^2~37^2~16^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8151d5e60232d31f35e04f4e49a5b0d98b00a737;p=firefly-linux-kernel-4.4.55.git ASoC: compress: Prevent multicodec for compressed stream Multiple codecs does not make sense in the case of compressed stream. Exit with error if it happens. Signed-off-by: Benoit Cousson Tested-by: Lars-Peter Clausen Reviewed-by: Lars-Peter Clausen Acked-by: Vinod Koul Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c index f96fb96b2678..27c06acce205 100644 --- a/sound/soc/soc-compress.c +++ b/sound/soc/soc-compress.c @@ -629,6 +629,11 @@ int soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num) char new_name[64]; int ret = 0, direction = 0; + if (rtd->num_codecs > 1) { + dev_err(rtd->card->dev, "Multicodec not supported for compressed stream\n"); + return -EINVAL; + } + /* check client and interface hw capabilities */ snprintf(new_name, sizeof(new_name), "%s %s-%d", rtd->dai_link->stream_name, codec_dai->name, num);