|
@@ -3149,7 +3149,7 @@ static struct snd_soc_dai *soc_add_dai(struct snd_soc_component *component,
|
|
|
if (!dai->driver->ops)
|
|
|
dai->driver->ops = &null_dai_ops;
|
|
|
|
|
|
- list_add(&dai->list, &component->dai_list);
|
|
|
+ list_add_tail(&dai->list, &component->dai_list);
|
|
|
component->num_dai++;
|
|
|
|
|
|
dev_dbg(dev, "ASoC: Registered DAI '%s'\n", dai->name);
|
|
@@ -3176,8 +3176,6 @@ static int snd_soc_register_dais(struct snd_soc_component *component,
|
|
|
|
|
|
dev_dbg(dev, "ASoC: dai register %s #%zu\n", dev_name(dev), count);
|
|
|
|
|
|
- component->dai_drv = dai_drv;
|
|
|
-
|
|
|
for (i = 0; i < count; i++) {
|
|
|
|
|
|
dai = soc_add_dai(component, dai_drv + i,
|
|
@@ -4354,6 +4352,7 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
|
|
|
args,
|
|
|
dai_name);
|
|
|
} else {
|
|
|
+ struct snd_soc_dai *dai;
|
|
|
int id = -1;
|
|
|
|
|
|
switch (args->args_count) {
|
|
@@ -4375,7 +4374,14 @@ int snd_soc_get_dai_name(struct of_phandle_args *args,
|
|
|
|
|
|
ret = 0;
|
|
|
|
|
|
- *dai_name = pos->dai_drv[id].name;
|
|
|
+ /* find target DAI */
|
|
|
+ list_for_each_entry(dai, &pos->dai_list, list) {
|
|
|
+ if (id == 0)
|
|
|
+ break;
|
|
|
+ id--;
|
|
|
+ }
|
|
|
+
|
|
|
+ *dai_name = dai->driver->name;
|
|
|
if (!*dai_name)
|
|
|
*dai_name = pos->name;
|
|
|
}
|