diff mbox series

[v5,09/16] drm/mediatek: Use pm_runtime_resume_and_get for PM get_sync

Message ID 20210410091128.31823-10-yong.wu@mediatek.com
State New
Headers show
Series Clean up "mediatek,larb" | expand

Commit Message

Yong Wu (吴勇) April 10, 2021, 9:11 a.m. UTC
pm_runtime_get_sync will increment pm usage counter even it failed.
This patch use pm_runtime_resume_and_get instead of pm_runtime_get
to keep usage counter balanced.

Signed-off-by: Yong Wu <yong.wu@mediatek.com>
---
 drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthias Brugger June 9, 2021, 1:52 p.m. UTC | #1
On 10/04/2021 11:11, Yong Wu wrote:
> pm_runtime_get_sync will increment pm usage counter even it failed.

> This patch use pm_runtime_resume_and_get instead of pm_runtime_get

> to keep usage counter balanced.

> 

> Signed-off-by: Yong Wu <yong.wu@mediatek.com>


Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>


> ---

>  drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c

> index 8b0de90156c6..69d23ce56d2c 100644

> --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c

> +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c

> @@ -259,7 +259,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)

>  		drm_connector_list_iter_end(&conn_iter);

>  	}

>  

> -	ret = pm_runtime_get_sync(crtc->dev->dev);

> +	ret = pm_runtime_resume_and_get(crtc->dev->dev);

>  	if (ret < 0) {

>  		DRM_ERROR("Failed to enable power domain: %d\n", ret);

>  		return ret;

>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
index 8b0de90156c6..69d23ce56d2c 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c
@@ -259,7 +259,7 @@  static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)
 		drm_connector_list_iter_end(&conn_iter);
 	}
 
-	ret = pm_runtime_get_sync(crtc->dev->dev);
+	ret = pm_runtime_resume_and_get(crtc->dev->dev);
 	if (ret < 0) {
 		DRM_ERROR("Failed to enable power domain: %d\n", ret);
 		return ret;