ASoC: rockchip: sai: Fix stuck on probe

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I459bcd7e4db2396a1e27d13741d6018dd08c63a7
This commit is contained in:
Sugar Zhang
2024-02-27 16:17:52 +08:00
committed by Tao Huang
parent 12df5e18d8
commit 34fa929b18

View File

@@ -1480,15 +1480,19 @@ static int rockchip_sai_probe(struct platform_device *pdev)
return PTR_ERR(sai->hclk);
}
ret = clk_prepare_enable(sai->hclk);
if (ret)
return ret;
regmap_read(sai->regmap, SAI_VERSION, &sai->version);
ret = rockchip_sai_parse_quirks(sai);
if (ret)
return ret;
goto err_disable_hclk;
ret = rockchip_sai_init_dai(sai, res, &dai);
if (ret)
return ret;
goto err_disable_hclk;
/*
* MUST: after pm_runtime_enable step, any register R/W
@@ -1514,6 +1518,7 @@ static int rockchip_sai_probe(struct platform_device *pdev)
goto err_runtime_suspend;
if (device_property_read_bool(&pdev->dev, "rockchip,no-dmaengine")) {
clk_disable_unprepare(sai->hclk);
dev_info(&pdev->dev, "Used for Multi-DAI\n");
return 0;
}
@@ -1526,6 +1531,8 @@ static int rockchip_sai_probe(struct platform_device *pdev)
if (ret)
goto err_runtime_suspend;
clk_disable_unprepare(sai->hclk);
return 0;
err_runtime_suspend:
@@ -1533,6 +1540,8 @@ err_runtime_suspend:
rockchip_sai_runtime_suspend(&pdev->dev);
err_runtime_disable:
pm_runtime_disable(&pdev->dev);
err_disable_hclk:
clk_disable_unprepare(sai->hclk);
return ret;
}