drm/bridge: Add missing pm_runtime_put_sync
authorYongzhi Liu <lyz_cs@pku.edu.cn>
Mon, 24 Jan 2022 07:20:35 +0000 (23:20 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Apr 2022 18:59:02 +0000 (20:59 +0200)
commitff13c90d7f7ab606b37be6d15140d19013d6736c
tree37e4fedb9031dba4eb68e85616facfdfcf1b5379
parent35380262304ff5fc9432c0d9d6793d5d39634cc6
drm/bridge: Add missing pm_runtime_put_sync

[ Upstream commit 46f47807738441e354873546dde0b000106c068a ]

pm_runtime_get_sync() will increase the rumtime PM counter
even when 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. Besides, a matching decrement is needed
on the error handling path to keep the counter balanced.

Signed-off-by: Yongzhi Liu <lyz_cs@pku.edu.cn>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1643008835-73961-1-git-send-email-lyz_cs@pku.edu.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/bridge/nwl-dsi.c