Merge tag 'pstore-v5.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees...
[linux-2.6-block.git] / sound / soc / qcom / apq8016_sbc.c
index 0f56bcc46b00d5770763ee40b32f4a17db699ecc..f60a71990f662acd40ea1e5cd22bc43464a4eba7 100644 (file)
@@ -117,6 +117,7 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
        struct snd_soc_dai_link *link;
        struct device_node *np, *codec, *cpu, *node  = dev->of_node;
        struct apq8016_sbc_data *data;
+       struct snd_soc_dai_link_component *dlc;
        int ret, num_links;
 
        ret = snd_soc_of_parse_card_name(card, "qcom,model");
@@ -149,6 +150,16 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
 
        link = data->dai_link;
 
+       dlc = devm_kzalloc(dev, 2 * sizeof(*dlc), GFP_KERNEL);
+       if (!dlc)
+               return ERR_PTR(-ENOMEM);
+
+       link->cpus      = &dlc[0];
+       link->platforms = &dlc[1];
+
+       link->num_cpus          = 1;
+       link->num_platforms     = 1;
+
        for_each_child_of_node(node, np) {
                cpu = of_get_child_by_name(np, "cpu");
                codec = of_get_child_by_name(np, "codec");
@@ -159,14 +170,14 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
                        goto error;
                }
 
-               link->cpu_of_node = of_parse_phandle(cpu, "sound-dai", 0);
-               if (!link->cpu_of_node) {
+               link->cpus->of_node = of_parse_phandle(cpu, "sound-dai", 0);
+               if (!link->cpus->of_node) {
                        dev_err(card->dev, "error getting cpu phandle\n");
                        ret = -EINVAL;
                        goto error;
                }
 
-               ret = snd_soc_of_get_dai_name(cpu, &link->cpu_dai_name);
+               ret = snd_soc_of_get_dai_name(cpu, &link->cpus->dai_name);
                if (ret) {
                        dev_err(card->dev, "error getting cpu dai name\n");
                        goto error;
@@ -179,7 +190,7 @@ static struct apq8016_sbc_data *apq8016_sbc_parse_of(struct snd_soc_card *card)
                        goto error;
                }
 
-               link->platform_of_node = link->cpu_of_node;
+               link->platforms->of_node = link->cpus->of_node;
                ret = of_property_read_string(np, "link-name", &link->name);
                if (ret) {
                        dev_err(card->dev, "error getting codec dai_link name\n");