OSDN Git Service

drm/rockchip: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
authorYuan Can <yuancan@huawei.com>
Wed, 15 Jun 2022 06:26:44 +0000 (06:26 +0000)
committerHeiko Stuebner <heiko@sntech.de>
Sat, 29 Oct 2022 21:48:46 +0000 (23:48 +0200)
Replace pm_runtime_get_sync() with pm_runtime_resume_and_get() to avoid
device usage counter leak.

Signed-off-by: Yuan Can <yuancan@huawei.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220615062644.96837-1-yuancan@huawei.com
drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

index 313231d..92b599b 100644 (file)
@@ -1207,7 +1207,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;
index c356de5..fa1f4ee 100644 (file)
@@ -602,7 +602,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;
@@ -1983,7 +1983,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;
index aac20be..ad87db2 100644 (file)
@@ -822,7 +822,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;