Skip to content

Commit 5cb4751

Browse files
Yang Yingliangbroonie
authored andcommitted
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: 33f1ef6 ("spi: cadence-quadspi: Add clock configuration for StarFive JH7110 QSPI") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20231129081147.628004-1-yangyingliang@huawei.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 06891af commit 5cb4751

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/spi/spi-cadence-quadspi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ static int cqspi_probe(struct platform_device *pdev)
18401840
if (ddata->jh7110_clk_init) {
18411841
ret = cqspi_jh7110_clk_init(pdev, cqspi);
18421842
if (ret)
1843-
goto probe_clk_failed;
1843+
goto probe_reset_failed;
18441844
}
18451845

18461846
if (of_device_is_compatible(pdev->dev.of_node,
@@ -1901,6 +1901,8 @@ static int cqspi_probe(struct platform_device *pdev)
19011901
probe_setup_failed:
19021902
cqspi_controller_enable(cqspi, 0);
19031903
probe_reset_failed:
1904+
if (cqspi->is_jh7110)
1905+
cqspi_jh7110_disable_clk(pdev, cqspi);
19041906
clk_disable_unprepare(cqspi->clk);
19051907
probe_clk_failed:
19061908
return ret;

0 commit comments

Comments
 (0)