2022-12-16 13:13:37 +00:00
|
|
|
--- a/drivers/spi/spi-mt65xx.c
|
|
|
|
+++ b/drivers/spi/spi-mt65xx.c
|
2023-03-10 23:53:54 +00:00
|
|
|
@@ -1231,10 +1231,16 @@ static int mtk_spi_probe(struct platform
|
2022-12-16 13:13:37 +00:00
|
|
|
goto err_disable_spi_hclk;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ ret = clk_prepare_enable(mdata->sel_clk);
|
|
|
|
+ if (ret < 0) {
|
|
|
|
+ dev_err(&pdev->dev, "failed to enable sel_clk (%d)\n", ret);
|
|
|
|
+ goto err_disable_spi_clk;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
ret = clk_set_parent(mdata->sel_clk, mdata->parent_clk);
|
|
|
|
if (ret < 0) {
|
|
|
|
dev_err(&pdev->dev, "failed to clk_set_parent (%d)\n", ret);
|
|
|
|
- goto err_disable_spi_clk;
|
|
|
|
+ goto err_disable_spi_sel_clk;
|
|
|
|
}
|
|
|
|
|
|
|
|
mdata->spi_clk_hz = clk_get_rate(mdata->spi_clk);
|
2023-03-10 23:53:54 +00:00
|
|
|
@@ -1285,6 +1291,8 @@ static int mtk_spi_probe(struct platform
|
2022-12-16 13:13:37 +00:00
|
|
|
|
|
|
|
err_disable_runtime_pm:
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
|
|
+err_disable_spi_sel_clk:
|
|
|
|
+ clk_disable_unprepare(mdata->sel_clk);
|
|
|
|
err_disable_spi_clk:
|
|
|
|
clk_disable_unprepare(mdata->spi_clk);
|
|
|
|
err_disable_spi_hclk:
|