Commit dd1b25ec authored by Mark Brown's avatar Mark Brown

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
...@@ -1619,7 +1619,7 @@ static int cqspi_probe(struct platform_device *pdev) ...@@ -1619,7 +1619,7 @@ static int cqspi_probe(struct platform_device *pdev)
pm_runtime_enable(dev); pm_runtime_enable(dev);
ret = pm_runtime_resume_and_get(dev); ret = pm_runtime_resume_and_get(dev);
if (ret < 0) if (ret < 0)
return ret; goto probe_pm_failed;
ret = clk_prepare_enable(cqspi->clk); ret = clk_prepare_enable(cqspi->clk);
if (ret) { if (ret) {
...@@ -1712,6 +1712,7 @@ static int cqspi_probe(struct platform_device *pdev) ...@@ -1712,6 +1712,7 @@ static int cqspi_probe(struct platform_device *pdev)
clk_disable_unprepare(cqspi->clk); clk_disable_unprepare(cqspi->clk);
probe_clk_failed: probe_clk_failed:
pm_runtime_put_sync(dev); pm_runtime_put_sync(dev);
probe_pm_failed:
pm_runtime_disable(dev); pm_runtime_disable(dev);
return ret; return ret;
} }
......
...@@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev) ...@@ -293,8 +293,10 @@ static int dw_spi_bt1_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev); pm_runtime_enable(&pdev->dev);
ret = dw_spi_add_host(&pdev->dev, dws); ret = dw_spi_add_host(&pdev->dev, dws);
if (ret) if (ret) {
pm_runtime_disable(&pdev->dev);
goto err_disable_clk; goto err_disable_clk;
}
platform_set_drvdata(pdev, dwsbt1); platform_set_drvdata(pdev, dwsbt1);
......
...@@ -412,6 +412,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev) ...@@ -412,6 +412,7 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
return status; return status;
err_fck: err_fck:
pm_runtime_disable(&pdev->dev);
clk_disable_unprepare(spi100k->fck); clk_disable_unprepare(spi100k->fck);
err_ick: err_ick:
clk_disable_unprepare(spi100k->ick); clk_disable_unprepare(spi100k->ick);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment