PCI: cadence: Fix runtime PM imbalance on error

pm_runtime_get_sync() increments the runtime PM usage counter even
it returns an error code. Thus a pairing decrement is needed on
the error handling path to keep the counter balanced.

Link: https://lore.kernel.org/r/20200520090253.2761-1-dinghao.liu@zju.edu.cn
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
This commit is contained in:
Dinghao Liu 2020-05-20 17:02:53 +08:00 коммит произвёл Lorenzo Pieralisi
Родитель c2615d620a
Коммит 7a790087c1
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -115,9 +115,8 @@ static int cdns_plat_pcie_probe(struct platform_device *pdev)
}
err_init:
pm_runtime_put_sync(dev);
err_get_sync:
pm_runtime_put_sync(dev);
pm_runtime_disable(dev);
cdns_pcie_disable_phy(cdns_plat_pcie->pcie);
phy_count = cdns_plat_pcie->pcie->phy_count;