Skip to content

Commit c4dce0c

Browse files
committed
Merge tag 'spi-fix-v6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi
Pull spi fix from Mark Brown: "One fix for a runtime PM underflow when removing the Cadence QuadSPI driver" * tag 'spi-fix-v6.16-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-cadence-quadspi: Fix pm runtime unbalance
2 parents 92ca6c4 + b07f349 commit c4dce0c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/spi/spi-cadence-quadspi.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1958,10 +1958,10 @@ static int cqspi_probe(struct platform_device *pdev)
19581958
goto probe_setup_failed;
19591959
}
19601960

1961-
ret = devm_pm_runtime_enable(dev);
1962-
if (ret) {
1963-
if (cqspi->rx_chan)
1964-
dma_release_channel(cqspi->rx_chan);
1961+
pm_runtime_enable(dev);
1962+
1963+
if (cqspi->rx_chan) {
1964+
dma_release_channel(cqspi->rx_chan);
19651965
goto probe_setup_failed;
19661966
}
19671967

@@ -1981,6 +1981,7 @@ static int cqspi_probe(struct platform_device *pdev)
19811981
return 0;
19821982
probe_setup_failed:
19831983
cqspi_controller_enable(cqspi, 0);
1984+
pm_runtime_disable(dev);
19841985
probe_reset_failed:
19851986
if (cqspi->is_jh7110)
19861987
cqspi_jh7110_disable_clk(pdev, cqspi);
@@ -1999,7 +2000,8 @@ static void cqspi_remove(struct platform_device *pdev)
19992000
if (cqspi->rx_chan)
20002001
dma_release_channel(cqspi->rx_chan);
20012002

2002-
clk_disable_unprepare(cqspi->clk);
2003+
if (pm_runtime_get_sync(&pdev->dev) >= 0)
2004+
clk_disable(cqspi->clk);
20032005

20042006
if (cqspi->is_jh7110)
20052007
cqspi_jh7110_disable_clk(pdev, cqspi);

0 commit comments

Comments
 (0)