All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
@ 2022-09-23 13:38 Zhang Qilong
  2022-09-25 11:08 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Qilong @ 2022-09-23 13:38 UTC (permalink / raw)
  To: eller; +Cc: linux-omap, linux-fbdev

Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
 drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/dsi.c   | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/dss.c   | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 6 ++----
 drivers/video/fbdev/omap2/omapfb/dss/venc.c  | 6 ++----
 6 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
index b2d6e6df2161..92fb6b7e1f68 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
@@ -519,11 +519,9 @@ int dispc_runtime_get(void)
 
 	DSSDBG("dispc_runtime_get\n");
 
-	r = pm_runtime_get_sync(&dispc.pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&dispc.pdev->dev);
+	r = pm_runtime_resume_and_get(&dispc.pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 EXPORT_SYMBOL(dispc_runtime_get);
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
index d43b081d592f..54b0f034c2ed 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
@@ -1136,11 +1136,9 @@ static int dsi_runtime_get(struct platform_device *dsidev)
 
 	DSSDBG("dsi_runtime_get\n");
 
-	r = pm_runtime_get_sync(&dsi->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&dsi->pdev->dev);
+	r = pm_runtime_resume_and_get(&dsi->pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
index 45b9d3cf3860..335e0af4eec1 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
@@ -767,11 +767,9 @@ int dss_runtime_get(void)
 
 	DSSDBG("dss_runtime_get\n");
 
-	r = pm_runtime_get_sync(&dss.pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&dss.pdev->dev);
+	r = pm_runtime_resume_and_get(&dss.pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
index 800bd108e834..0f39612e002e 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
@@ -38,11 +38,9 @@ static int hdmi_runtime_get(void)
 
 	DSSDBG("hdmi_runtime_get\n");
 
-	r = pm_runtime_get_sync(&hdmi.pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&hdmi.pdev->dev);
+	r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 
 	return 0;
 }
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
index 2c03608addcd..bfccc2cb917a 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
@@ -42,11 +42,9 @@ static int hdmi_runtime_get(void)
 
 	DSSDBG("hdmi_runtime_get\n");
 
-	r = pm_runtime_get_sync(&hdmi.pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&hdmi.pdev->dev);
+	r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 
 	return 0;
 }
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
index 905d642ff9ed..78a7309d25dd 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
@@ -347,11 +347,9 @@ static int venc_runtime_get(void)
 
 	DSSDBG("venc_runtime_get\n");
 
-	r = pm_runtime_get_sync(&venc.pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_sync(&venc.pdev->dev);
+	r = pm_runtime_resume_and_get(&venc.pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync
  2022-09-23 13:38 [PATCH -next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Zhang Qilong
@ 2022-09-25 11:08 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-09-25 11:08 UTC (permalink / raw)
  To: Zhang Qilong; +Cc: linux-omap, linux-fbdev

On 9/23/22 15:38, Zhang Qilong wrote:
> Using the newest pm_runtime_resume_and_get is more appropriate
> for simplifing code here.
>
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>

applied.

Thanks!
Helge


> ---
>   drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dsi.c   | 6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/dss.c   | 6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c | 6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c | 6 ++----
>   drivers/video/fbdev/omap2/omapfb/dss/venc.c  | 6 ++----
>   6 files changed, 12 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> index b2d6e6df2161..92fb6b7e1f68 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.c
> @@ -519,11 +519,9 @@ int dispc_runtime_get(void)
>
>   	DSSDBG("dispc_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&dispc.pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&dispc.pdev->dev);
> +	r = pm_runtime_resume_and_get(&dispc.pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>   	return 0;
>   }
>   EXPORT_SYMBOL(dispc_runtime_get);
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
> index d43b081d592f..54b0f034c2ed 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dsi.c
> @@ -1136,11 +1136,9 @@ static int dsi_runtime_get(struct platform_device *dsidev)
>
>   	DSSDBG("dsi_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&dsi->pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&dsi->pdev->dev);
> +	r = pm_runtime_resume_and_get(&dsi->pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>   	return 0;
>   }
>
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.c b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> index 45b9d3cf3860..335e0af4eec1 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.c
> @@ -767,11 +767,9 @@ int dss_runtime_get(void)
>
>   	DSSDBG("dss_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&dss.pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&dss.pdev->dev);
> +	r = pm_runtime_resume_and_get(&dss.pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>   	return 0;
>   }
>
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
> index 800bd108e834..0f39612e002e 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
> @@ -38,11 +38,9 @@ static int hdmi_runtime_get(void)
>
>   	DSSDBG("hdmi_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&hdmi.pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&hdmi.pdev->dev);
> +	r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>
>   	return 0;
>   }
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
> index 2c03608addcd..bfccc2cb917a 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
> @@ -42,11 +42,9 @@ static int hdmi_runtime_get(void)
>
>   	DSSDBG("hdmi_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&hdmi.pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&hdmi.pdev->dev);
> +	r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>
>   	return 0;
>   }
> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/venc.c b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
> index 905d642ff9ed..78a7309d25dd 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/venc.c
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/venc.c
> @@ -347,11 +347,9 @@ static int venc_runtime_get(void)
>
>   	DSSDBG("venc_runtime_get\n");
>
> -	r = pm_runtime_get_sync(&venc.pdev->dev);
> -	if (WARN_ON(r < 0)) {
> -		pm_runtime_put_sync(&venc.pdev->dev);
> +	r = pm_runtime_resume_and_get(&venc.pdev->dev);
> +	if (WARN_ON(r < 0))
>   		return r;
> -	}
>   	return 0;
>   }
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-25 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 13:38 [PATCH -next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Zhang Qilong
2022-09-25 11:08 ` Helge Deller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.