diff mbox series

[-next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

Message ID 20220923133844.69659-1-zhangqilong3@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] omapfb: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync | expand

Commit Message

Zhang Qilong Sept. 23, 2022, 1:38 p.m. UTC
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(-)

Comments

Helge Deller Sept. 25, 2022, 11:08 a.m. UTC | #1
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;
>   }
>
diff mbox series

Patch

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;
 }