Skip to content

Commit

Permalink
ASoC: core: Fix the DAI name getting.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and Mark Brown committed Dec 31, 2013
1 parent 95ab129 commit e41975e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e41975e

Please sign in to comment.