Commit c4dce0c0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 92ca6c49 b07f349d
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -1958,9 +1958,9 @@ static int cqspi_probe(struct platform_device *pdev)
			goto probe_setup_failed;
	}

	ret = devm_pm_runtime_enable(dev);
	if (ret) {
		if (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);