Unverified Commit dd1b25ec authored by Mark Brown's avatar Mark Brown
Browse files

Fix PM disable depth imbalance in probe

Merge series from Zhang Qilong <zhangqilong3@huawei.com>:

The pm_runtime_enable will increase power disable depth. Thus
a pairing decrement is needed when error returns to keep it
balanced. This series of patches fixed it in spi probe.
parents fc13b5a2 29f65f21
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1619,7 +1619,7 @@ static int cqspi_probe(struct platform_device *pdev)
	pm_runtime_enable(dev);
	ret = pm_runtime_resume_and_get(dev);
	if (ret < 0)
		return ret;
		goto probe_pm_failed;

	ret = clk_prepare_enable(cqspi->clk);
	if (ret) {
@@ -1712,6 +1712,7 @@ static int cqspi_probe(struct platform_device *pdev)
	clk_disable_unprepare(cqspi->clk);
probe_clk_failed:
	pm_runtime_put_sync(dev);
probe_pm_failed:
	pm_runtime_disable(dev);
	return ret;
}
+3 −1
Original line number Diff line number Diff line
@@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
	pm_runtime_enable(&pdev->dev);

	ret = dw_spi_add_host(&pdev->dev, dws);
	if (ret)
	if (ret) {
		pm_runtime_disable(&pdev->dev);
		goto err_disable_clk;
	}

	platform_set_drvdata(pdev, dwsbt1);

+1 −0
Original line number Diff line number Diff line
@@ -412,6 +412,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
	return status;

err_fck:
	pm_runtime_disable(&pdev->dev);
	clk_disable_unprepare(spi100k->fck);
err_ick:
	clk_disable_unprepare(spi100k->ick);