PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 8 Apr 2021 07:24:02 +0000 (15:24 +0800)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:32:57 +0000 (12:32 +0100)
commit84a0a44b1fc14525abfca4e172202a05a2ced7d5
treebb28930294435cff3f1affcdd2f7cab7e4e8e5d1
parent6ca13784bbaa6eeecc2d5b73776d66a35a259d27
PCI: rcar: Fix runtime PM imbalance in rcar_pcie_ep_probe()

[ Upstream commit 1e29cd9983eba1b596bc07f94d81d728007f8a25 ]

pm_runtime_get_sync() will increase the runtime PM counter
even it returns an error. Thus a pairing decrement is needed
to prevent refcount leak. Fix this by replacing this API with
pm_runtime_resume_and_get(), which will not change the runtime
PM counter on error.

Link: https://lore.kernel.org/r/20210408072402.15069-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>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pcie-rcar-ep.c