aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@intel.com>2011-04-06 11:25:11 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-04-06 19:25:45 -0400
commitb04cfcf70b35e032071a6b482273cc642675c8e4 (patch)
tree417d9fb51e846a7b6bcff22157be33509b422d19 /sound/soc
parentdeb2607e6c3d75c7185bb8aba658d9cd57e6e54a (diff)
ASoC: check channel mismatch between cpu_dai and codec_dai
Suppose we have: cpu_dai channels_min = 1 channels_max = 1 codec_dai channels_min = 2 channels_max = 2 This is a mismatch that should not happen, however according to the current code, the result of runtime->hw will be: channels_min = 2 channels_max = 1 We better spot it early. This patch checks this mismatch. Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 960718b3beb..4f42fef26c9 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -640,7 +640,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
640 codec_dai->name, cpu_dai->name); 640 codec_dai->name, cpu_dai->name);
641 goto config_err; 641 goto config_err;
642 } 642 }
643 if (!runtime->hw.channels_min || !runtime->hw.channels_max) { 643 if (!runtime->hw.channels_min || !runtime->hw.channels_max ||
644 runtime->hw.channels_min > runtime->hw.channels_max) {
644 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n", 645 printk(KERN_ERR "asoc: %s <-> %s No matching channels\n",
645 codec_dai->name, cpu_dai->name); 646 codec_dai->name, cpu_dai->name);
646 goto config_err; 647 goto config_err;