ASoC: snd_soc_register_component() uses properly snd_soc_register_dai[s]()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thu, 21 Mar 2013 10:27:13 +0000 (03:27 -0700)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 26 Mar 2013 21:55:21 +0000 (21:55 +0000)
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 <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/soc-core.c

index 9e6118573fefc23b6829025886c86bc398e75f66..2ecaaf13e319e250bd18142d57e4adf04b7a64d0 100644 (file)
@@ -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;