PCI: tegra: Fix runtime PM imbalance in pex_ep_event_pex_rst_deassert()
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Thu, 8 Apr 2021 07:26:58 +0000 (15:26 +0800)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Thu, 8 Apr 2021 17:10:35 +0000 (18:10 +0100)
commit5859c926d1f052ee61b5815b14658875c14f6243
tree490e0ce687f89d64a10fc59237f005157ecb020e
parent10739e2a5e83ecac6a7d2422369c5fe8a1a72b04
PCI: tegra: Fix runtime PM imbalance in pex_ep_event_pex_rst_deassert()

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/20210408072700.15791-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>
Acked-by: Thierry Reding <treding@nvidia.com>
drivers/pci/controller/dwc/pcie-tegra194.c