summaryrefslogtreecommitdiff
path: root/sound/soc/soc-core.c
diff options
context:
space:
mode:
authorXiubo Li <Li.Xiubo@freescale.com>2013-12-20 14:39:51 +0800
committerMark Brown <broonie@linaro.org>2013-12-31 16:27:44 +0000
commite41975edc73d2c16d0784e5fa87a6162e2fcab80 (patch)
tree9734475724983a02fd470e9cdc759a870f8b30e7 /sound/soc/soc-core.c
parent95ab1297e7b1a57c2b777f210b74f3a2bd2ac269 (diff)
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;