]> www.infradead.org Git - users/hch/misc.git/commitdiff
ASoC: imx-hdmi: remove cpu_pdev related code
authorShengjiu Wang <shengjiu.wang@nxp.com>
Wed, 20 Aug 2025 03:16:41 +0000 (11:16 +0800)
committerMark Brown <broonie@kernel.org>
Sun, 24 Aug 2025 21:41:09 +0000 (22:41 +0100)
If a defer probe happens for the cpu device, the return value for
cpu_pdev "ret = -EINVAL" breaks defer probe. As the cpus->dai_name
can be replaced by cpus->of_node, to simplify the code, remove related
code for cpu_pdev.

Fixes: 6a5f850aa83a ("ASoC: fsl: Add imx-hdmi machine driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Message-ID: <20250820031641.2158261-1-shengjiu.wang@nxp.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/imx-hdmi.c

index fe47b439a8183d47f83325e18c8854118797fac1..1115189cc6400aaeb170dd78e70a329ce1517f14 100644 (file)
@@ -101,7 +101,6 @@ static int imx_hdmi_probe(struct platform_device *pdev)
        bool hdmi_out = of_property_read_bool(np, "hdmi-out");
        bool hdmi_in = of_property_read_bool(np, "hdmi-in");
        struct snd_soc_dai_link_component *dlc;
-       struct platform_device *cpu_pdev;
        struct device_node *cpu_np;
        struct imx_hdmi_data *data;
        int ret;
@@ -117,17 +116,9 @@ static int imx_hdmi_probe(struct platform_device *pdev)
                goto fail;
        }
 
-       cpu_pdev = of_find_device_by_node(cpu_np);
-       if (!cpu_pdev) {
-               dev_err(&pdev->dev, "failed to find SAI platform device\n");
-               ret = -EINVAL;
-               goto fail;
-       }
-
        data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
        if (!data) {
                ret = -ENOMEM;
-               put_device(&cpu_pdev->dev);
                goto fail;
        }
 
@@ -140,15 +131,13 @@ static int imx_hdmi_probe(struct platform_device *pdev)
 
        data->dai.name = "i.MX HDMI";
        data->dai.stream_name = "i.MX HDMI";
-       data->dai.cpus->dai_name = dev_name(&cpu_pdev->dev);
+       data->dai.cpus->of_node = cpu_np;
        data->dai.platforms->of_node = cpu_np;
        data->dai.ops = &imx_hdmi_ops;
        data->dai.playback_only = true;
        data->dai.capture_only = false;
        data->dai.init = imx_hdmi_init;
 
-       put_device(&cpu_pdev->dev);
-
        if (of_node_name_eq(cpu_np, "sai")) {
                data->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1;
                data->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;