summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorXiubo Li2013-12-20 07:39:51 +0100
committerMark Brown2013-12-31 17:27:44 +0100
commite41975edc73d2c16d0784e5fa87a6162e2fcab80 (patch)
tree9734475724983a02fd470e9cdc759a870f8b30e7 /sound/soc/soc-core.c
parentASoC: soc-utils: Don't set unused struct snd_pcm_hardware fields (diff)
downloadkernel-qcow2-linux-e41975edc73d2c16d0784e5fa87a6162e2fcab80.tar.gz
kernel-qcow2-linux-e41975edc73d2c16d0784e5fa87a6162e2fcab80.tar.xz
kernel-qcow2-linux-e41975edc73d2c16d0784e5fa87a6162e2fcab80.zip
ASoC: core: Fix the DAI name getting.
From "ASoC: make snd_soc_dai_link more symmetrical", can we see that the name of CPU DAI maybe omitted. If the DAI name is omitted, try to use the component name instead. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r--sound/soc/soc-core.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4e53d87e881d..03c779ebd729 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -4617,10 +4617,14 @@ int snd_soc_of_get_dai_name(struct device_node *of_node,
if (id < 0 || id >= pos->num_dai) {
ret = -EINVAL;
- } else {
- *dai_name = pos->dai_drv[id].name;
- ret = 0;
+ break;
}
+
+ ret = 0;
+
+ *dai_name = pos->dai_drv[id].name;
+ if (!*dai_name)
+ *dai_name = pos->name;
}
break;