Commit 5cb47517 authored by Yang Yingliang's avatar Yang Yingliang Committed by Mark Brown

spi: cadence-quadspi: add missing clk_disable_unprepare() in cqspi_probe()

cqspi_jh7110_clk_init() is called after clk_prepare_enable(cqspi->clk),
if it fails, it should goto label 'probe_reset_failed' to disable
cqspi->clk.

In the error path after calling cqspi_jh7110_clk_init(),
cqspi_jh7110_disable_clk() need be called.

Fixes: 33f1ef6d ("spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20231129081147.628004-1-yangyingliang@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 06891af2
...@@ -1840,7 +1840,7 @@ static int cqspi_probe(struct platform_device *pdev) ...@@ -1840,7 +1840,7 @@ static int cqspi_probe(struct platform_device *pdev)
if (ddata->jh7110_clk_init) { if (ddata->jh7110_clk_init) {
ret = cqspi_jh7110_clk_init(pdev, cqspi); ret = cqspi_jh7110_clk_init(pdev, cqspi);
if (ret) if (ret)
goto probe_clk_failed; goto probe_reset_failed;
} }
if (of_device_is_compatible(pdev->dev.of_node, if (of_device_is_compatible(pdev->dev.of_node,
...@@ -1901,6 +1901,8 @@ static int cqspi_probe(struct platform_device *pdev) ...@@ -1901,6 +1901,8 @@ static int cqspi_probe(struct platform_device *pdev)
probe_setup_failed: probe_setup_failed:
cqspi_controller_enable(cqspi, 0); cqspi_controller_enable(cqspi, 0);
probe_reset_failed: probe_reset_failed:
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
clk_disable_unprepare(cqspi->clk); clk_disable_unprepare(cqspi->clk);
probe_clk_failed: probe_clk_failed:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment