@@ -1543,9 +1543,9 @@ static int qcom_pcie_probe(struct platform_device *pdev)
return -ENOMEM;
pm_runtime_enable(dev);
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0)
- goto err_pm_runtime_put;
+ goto err_pm_runtime_disable;
pci->dev = dev;
pci->ops = &dw_pcie_ops;
@@ -1594,7 +1594,6 @@ static int qcom_pcie_probe(struct platform_device *pdev)
ret = phy_init(pcie->phy);
if (ret) {
- pm_runtime_disable(&pdev->dev);
goto err_pm_runtime_put;
}
@@ -1603,7 +1602,6 @@ static int qcom_pcie_probe(struct platform_device *pdev)
ret = dw_pcie_host_init(pp);
if (ret) {
dev_err(dev, "cannot initialize host\n");
- pm_runtime_disable(&pdev->dev);
goto err_pm_runtime_put;
}
@@ -1611,6 +1609,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
err_pm_runtime_put:
pm_runtime_put(dev);
+err_pm_runtime_disable:
pm_runtime_disable(dev);
return ret;
Fix the error path in qcom_pcie_probe(): remove extra calls to pm_runtime_disable() (which will be called at the end of error path anyway). Replace a call to pm_runtime_get_sync() with pm_runtime_resume_and_get() to end up with cleaner code. Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/pci/controller/dwc/pcie-qcom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)