[PATCH -next] drm: omapdrm: dss: using pm_runtime_resume_and_get instead of pm_runtime_get_sync

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Zhang Qilong <zhangqilong3@xxxxxxxxxx>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c | 6 ++----
 drivers/gpu/drm/omapdrm/dss/dsi.c   | 6 ++----
 drivers/gpu/drm/omapdrm/dss/dss.c   | 6 ++----
 drivers/gpu/drm/omapdrm/dss/hdmi4.c | 6 ++----
 drivers/gpu/drm/omapdrm/dss/hdmi5.c | 6 ++----
 drivers/gpu/drm/omapdrm/dss/venc.c  | 6 ++----
 6 files changed, 12 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 0ee344ebcd1c..b6db72cf25f4 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -652,11 +652,9 @@ int dispc_runtime_get(struct dispc_device *dispc)
 
 	DSSDBG("dispc_runtime_get\n");
 
-	r = pm_runtime_get_sync(&dispc->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(&dispc->pdev->dev);
+	r = pm_runtime_resume_and_get(&dispc->pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dsi.c b/drivers/gpu/drm/omapdrm/dss/dsi.c
index a6845856cbce..7e28e314d34c 100644
--- a/drivers/gpu/drm/omapdrm/dss/dsi.c
+++ b/drivers/gpu/drm/omapdrm/dss/dsi.c
@@ -704,11 +704,9 @@ static int dsi_runtime_get(struct dsi_data *dsi)
 
 	DSSDBG("dsi_runtime_get\n");
 
-	r = pm_runtime_get_sync(dsi->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(dsi->dev);
+	r = pm_runtime_resume_and_get(dsi->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index c4febb861910..0e32ddf0e24a 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -857,11 +857,9 @@ int dss_runtime_get(struct dss_device *dss)
 
 	DSSDBG("dss_runtime_get\n");
 
-	r = pm_runtime_get_sync(&dss->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(&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/gpu/drm/omapdrm/dss/hdmi4.c b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
index a8a75dc24751..e802d42f12fe 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi4.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi4.c
@@ -43,11 +43,9 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi)
 
 	DSSDBG("hdmi_runtime_get\n");
 
-	r = pm_runtime_get_sync(&hdmi->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(&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/gpu/drm/omapdrm/dss/hdmi5.c b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
index 868712cd8a3a..96f78aa2b0ba 100644
--- a/drivers/gpu/drm/omapdrm/dss/hdmi5.c
+++ b/drivers/gpu/drm/omapdrm/dss/hdmi5.c
@@ -44,11 +44,9 @@ static int hdmi_runtime_get(struct omap_hdmi *hdmi)
 
 	DSSDBG("hdmi_runtime_get\n");
 
-	r = pm_runtime_get_sync(&hdmi->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(&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/gpu/drm/omapdrm/dss/venc.c b/drivers/gpu/drm/omapdrm/dss/venc.c
index 4480b69ab5a7..8c48f222351b 100644
--- a/drivers/gpu/drm/omapdrm/dss/venc.c
+++ b/drivers/gpu/drm/omapdrm/dss/venc.c
@@ -360,11 +360,9 @@ static int venc_runtime_get(struct venc_device *venc)
 
 	DSSDBG("venc_runtime_get\n");
 
-	r = pm_runtime_get_sync(&venc->pdev->dev);
-	if (WARN_ON(r < 0)) {
-		pm_runtime_put_noidle(&venc->pdev->dev);
+	r = pm_runtime_resume_and_get(&venc->pdev->dev);
+	if (WARN_ON(r < 0))
 		return r;
-	}
 	return 0;
 }
 
-- 
2.25.1




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux