fbdev: omapfb/dss: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
authorZhang Qilong <zhangqilong3@huawei.com>
Fri, 23 Sep 2022 13:38:44 +0000 (21:38 +0800)
committerHelge Deller <deller@gmx.de>
Sat, 8 Oct 2022 13:20:08 +0000 (15:20 +0200)
Using the newest pm_runtime_resume_and_get is more appropriate
for simplifing code here.

Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/omap2/omapfb/dss/dispc.c
drivers/video/fbdev/omap2/omapfb/dss/dsi.c
drivers/video/fbdev/omap2/omapfb/dss/dss.c
drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c
drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c
drivers/video/fbdev/omap2/omapfb/dss/venc.c

index b2d6e6d..92fb6b7 100644 (file)
@@ -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);
index d43b081..54b0f03 100644 (file)
@@ -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;
 }
 
index 45b9d3c..335e0af 100644 (file)
@@ -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;
 }
 
index 800bd10..0f39612 100644 (file)
@@ -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;
 }
index 2c03608..bfccc2c 100644 (file)
@@ -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;
 }
index 905d642..78a7309 100644 (file)
@@ -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;
 }