dmaengine: tegra20: Fix runtime PM imbalance on error
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Fri, 9 Apr 2021 08:28:05 +0000 (16:28 +0800)
committerVinod Koul <vkoul@kernel.org>
Mon, 12 Apr 2021 09:40:44 +0000 (15:10 +0530)
commit917a3200b9f467a154999c7572af345f2470aaf4
treeb0cc757e14b3bc1d83554a755de210be21a92f62
parentea45b6008f8095db0cc09ad6e03c7785c2986197
dmaengine: tegra20: Fix runtime PM imbalance on error

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.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20210409082805.23643-1-dinghao.liu@zju.edu.cn
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/tegra20-apb-dma.c