MLK-20247: ASoC: imx-rpmsg: fix error when m4 image is not loaded
authorShengjiu Wang <shengjiu.wang@nxp.com>
Fri, 9 Nov 2018 07:16:23 +0000 (15:16 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
The reason is same as commit d4eb8ab26399 ("MLK-19854-1: ASoC:
imx-cs42888: fix error when m4 image is not loaded")

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
(Vipul: Fixed merge conflicts)
Conflicts:
sound/soc/fsl/imx-rpmsg.c
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
sound/soc/fsl/imx-rpmsg.c

index 3c5641c..2478462 100644 (file)
@@ -35,6 +35,8 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
        struct platform_device *cpu_pdev;
        struct imx_rpmsg_data *data;
        struct fsl_rpmsg_i2s *rpmsg_i2s;
+       struct snd_soc_dai_link_component dlc = { 0 };
+       struct snd_soc_dai *codec_dai;
        int ret;
 
        cpu_np = of_parse_phandle(pdev->dev.of_node, "cpu-dai", 0);
@@ -83,6 +85,12 @@ static int imx_rpmsg_probe(struct platform_device *pdev)
                            SND_SOC_DAIFMT_CBS_CFS;
        }
 
+       dlc.name = data->dai[0].codec_name;
+       dlc.dai_name = data->dai[0].codec_dai_name;
+       codec_dai = snd_soc_find_dai(&dlc);
+       if (!codec_dai)
+               return -ENODEV;
+
        data->dai[0].cpu_dai_name = dev_name(&cpu_pdev->dev);
        data->dai[0].platform_of_node = cpu_np;
        data->dai[0].playback_only = true;