From: Kuninori Morimoto Date: Thu, 21 Mar 2013 10:27:13 +0000 (-0700) Subject: ASoC: snd_soc_register_component() uses properly snd_soc_register_dai[s]() X-Git-Tag: upstream/snapshot3+hdmi~5112^2~53^2~24^2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1422b8cb443c6cfc58da38394673b8b8eda6458;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ASoC: snd_soc_register_component() uses properly snd_soc_register_dai[s]() snd_soc_register_dai() uses fmt_single_name(), and snd_soc_register_dais() uses fmt_multiple_name() for dai->name which is used for name based matching. This patch uses properly snd_soc_register_dai() it it was single driver, and uses snd_register_dais() if it were multiple drivers. Signed-off-by: Kuninori Morimoto Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 9e61185..2ecaaf1 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -4169,7 +4169,15 @@ int snd_soc_register_component(struct device *dev, cmpnt->driver = cmpnt_drv; cmpnt->num_dai = num_dai; - ret = snd_soc_register_dais(dev, dai_drv, num_dai); + /* + * snd_soc_register_dai() uses fmt_single_name(), and + * snd_soc_register_dais() uses fmt_multiple_name() + * for dai->name which is used for name based matching + */ + if (1 == num_dai) + ret = snd_soc_register_dai(dev, dai_drv); + else + ret = snd_soc_register_dais(dev, dai_drv, num_dai); if (ret < 0) { dev_err(dev, "ASoC: Failed to regster DAIs: %d\n", ret); goto error_component_name;