sound:starfive:Change the order about mclk_ext's operation
authorXingyu Wu <xingyu.wu@starfivetech.com>
Tue, 11 Oct 2022 13:11:39 +0000 (21:11 +0800)
committerXingyu Wu <xingyu.wu@starfivetech.com>
Wed, 12 Oct 2022 13:40:48 +0000 (21:40 +0800)
Change the order about setting parent to mclk_ext after resets
when PDM registering.

Signed-off-by: Xingyu Wu <xingyu.wu@starfivetech.com>
sound/soc/starfive/starfive_pdm.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 89f539c..d6c10d6
@@ -296,12 +296,6 @@ static int sf_pdm_clock_init(struct platform_device *pdev, struct sf_pdm *priv)
                goto exit;
        }
 
-       ret = clk_set_parent(priv->clk_mclk, priv->clk_mclk_ext);
-       if (ret) {
-               dev_err(&pdev->dev, "failed to set parent clk_mclk ret=%d\n", ret);
-               goto exit;
-       }
-
        ret = clk_prepare_enable(priv->clk_mclk);
        if (ret) {
                dev_err(&pdev->dev, "failed to prepare enable clk_mclk\n");
@@ -338,6 +332,12 @@ static int sf_pdm_clock_init(struct platform_device *pdev, struct sf_pdm *priv)
                goto err_clk_disable;
        }
 
+       ret = clk_set_parent(priv->clk_mclk, priv->clk_mclk_ext);
+       if (ret) {
+               dev_err(&pdev->dev, "failed to set parent clk_mclk ret=%d\n", ret);
+               goto err_clk_disable;
+       }
+
        return 0;
 
 err_clk_disable: