Skip to content

Commit

Permalink
drm/rockchip: use pm_runtime_resume_and_get() instead of pm_runtime_g…
Browse files Browse the repository at this point in the history
…et_sync()

[ Upstream commit e355874 ]

Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() to avoid
device usage counter leak.

Signed-off-by: Yuan Can <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Yuan Can authored and Sasha Levin committed Dec 28, 2022
1 parent f3edb8d commit c49c879
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ static int dw_mipi_dsi_dphy_power_on(struct phy *phy)
return i;
}

ret = pm_runtime_get_sync(dsi->dev);
ret = pm_runtime_resume_and_get(dsi->dev);
if (ret < 0) {
DRM_DEV_ERROR(dsi->dev, "failed to enable device: %d\n", ret);
return ret;
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/rockchip/rockchip_drm_vop.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state)
struct vop *vop = to_vop(crtc);
int ret, i;

ret = pm_runtime_get_sync(vop->dev);
ret = pm_runtime_resume_and_get(vop->dev);
if (ret < 0) {
DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret);
return ret;
Expand Down Expand Up @@ -1953,7 +1953,7 @@ static int vop_initial(struct vop *vop)
return PTR_ERR(vop->dclk);
}

ret = pm_runtime_get_sync(vop->dev);
ret = pm_runtime_resume_and_get(vop->dev);
if (ret < 0) {
DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret);
return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ static void vop2_enable(struct vop2 *vop2)
{
int ret;

ret = pm_runtime_get_sync(vop2->dev);
ret = pm_runtime_resume_and_get(vop2->dev);
if (ret < 0) {
drm_err(vop2->drm, "failed to get pm runtime: %d\n", ret);
return;
Expand Down

0 comments on commit c49c879

Please sign in to comment.