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.
This commit is contained in:
commit
dd1b25ec8b
@ -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 @@ probe_reset_failed:
|
||||
clk_disable_unprepare(cqspi->clk);
|
||||
probe_clk_failed:
|
||||
pm_runtime_put_sync(dev);
|
||||
probe_pm_failed:
|
||||
pm_runtime_disable(dev);
|
||||
return ret;
|
||||
}
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user