spi: Fix for v6.16

One fix here, for a runtime PM underflow when removing the Cadence
 QuadSPI driver.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmhcRJwACgkQJNaLcl1U
 h9AYvQf9FnhR4jscljVcNb4T9poRcIgMdTzHSY1Y0Y6VavnUjX6oY+aQ3Z2GRZOd
 B79tRwYlZdOLAAw3mtQoxy+PBuuszFLU2pVnB1MD8j4kR7obPY3dAc9swgwtdWWN
 0OMnPRDIOoSdLUsgr8Yoedp6/nhDlsMirGxObPQ9BSGs2Jw9yKBGVLqFUwVFI9UQ
 iky+g2VFetBK5MVFhh2GsMbCJDnYRy6xx4egEwWxLlwD7Y2HtVH2gsDEJGlkuq8j
 HRX++UCSVuDE0y+Oejy+yfi4ujLOPZgJ9pED40kviK4hECJrS13/D6Da+nHCtt0S
 IID5P9uYDPWrje/B3gs9zaU4MyZW2A==
 =GcqT
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2025-06-25 11:54:04 -07:00
commit c4dce0c094

View File

@ -1958,10 +1958,10 @@ static int cqspi_probe(struct platform_device *pdev)
goto probe_setup_failed;
}
ret = devm_pm_runtime_enable(dev);
if (ret) {
if (cqspi->rx_chan)
dma_release_channel(cqspi->rx_chan);
pm_runtime_enable(dev);
if (cqspi->rx_chan) {
dma_release_channel(cqspi->rx_chan);
goto probe_setup_failed;
}
@ -1981,6 +1981,7 @@ static int cqspi_probe(struct platform_device *pdev)
return 0;
probe_setup_failed:
cqspi_controller_enable(cqspi, 0);
pm_runtime_disable(dev);
probe_reset_failed:
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
@ -1999,7 +2000,8 @@ static void cqspi_remove(struct platform_device *pdev)
if (cqspi->rx_chan)
dma_release_channel(cqspi->rx_chan);
clk_disable_unprepare(cqspi->clk);
if (pm_runtime_get_sync(&pdev->dev) >= 0)
clk_disable(cqspi->clk);
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);