Skip to content

Commit b0e0706

Browse files
Zhang Qilonghdeller
authored andcommitted
fbdev: omapfb/dss: Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
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>
1 parent 2559f17 commit b0e0706

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

drivers/video/fbdev/omap2/omapfb/dss/dispc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -519,11 +519,9 @@ int dispc_runtime_get(void)
519519

520520
DSSDBG("dispc_runtime_get\n");
521521

522-
r = pm_runtime_get_sync(&dispc.pdev->dev);
523-
if (WARN_ON(r < 0)) {
524-
pm_runtime_put_sync(&dispc.pdev->dev);
522+
r = pm_runtime_resume_and_get(&dispc.pdev->dev);
523+
if (WARN_ON(r < 0))
525524
return r;
526-
}
527525
return 0;
528526
}
529527
EXPORT_SYMBOL(dispc_runtime_get);

drivers/video/fbdev/omap2/omapfb/dss/dsi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,11 +1136,9 @@ static int dsi_runtime_get(struct platform_device *dsidev)
11361136

11371137
DSSDBG("dsi_runtime_get\n");
11381138

1139-
r = pm_runtime_get_sync(&dsi->pdev->dev);
1140-
if (WARN_ON(r < 0)) {
1141-
pm_runtime_put_sync(&dsi->pdev->dev);
1139+
r = pm_runtime_resume_and_get(&dsi->pdev->dev);
1140+
if (WARN_ON(r < 0))
11421141
return r;
1143-
}
11441142
return 0;
11451143
}
11461144

drivers/video/fbdev/omap2/omapfb/dss/dss.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,11 +767,9 @@ int dss_runtime_get(void)
767767

768768
DSSDBG("dss_runtime_get\n");
769769

770-
r = pm_runtime_get_sync(&dss.pdev->dev);
771-
if (WARN_ON(r < 0)) {
772-
pm_runtime_put_sync(&dss.pdev->dev);
770+
r = pm_runtime_resume_and_get(&dss.pdev->dev);
771+
if (WARN_ON(r < 0))
773772
return r;
774-
}
775773
return 0;
776774
}
777775

drivers/video/fbdev/omap2/omapfb/dss/hdmi4.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,9 @@ static int hdmi_runtime_get(void)
3838

3939
DSSDBG("hdmi_runtime_get\n");
4040

41-
r = pm_runtime_get_sync(&hdmi.pdev->dev);
42-
if (WARN_ON(r < 0)) {
43-
pm_runtime_put_sync(&hdmi.pdev->dev);
41+
r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
42+
if (WARN_ON(r < 0))
4443
return r;
45-
}
4644

4745
return 0;
4846
}

drivers/video/fbdev/omap2/omapfb/dss/hdmi5.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ static int hdmi_runtime_get(void)
4242

4343
DSSDBG("hdmi_runtime_get\n");
4444

45-
r = pm_runtime_get_sync(&hdmi.pdev->dev);
46-
if (WARN_ON(r < 0)) {
47-
pm_runtime_put_sync(&hdmi.pdev->dev);
45+
r = pm_runtime_resume_and_get(&hdmi.pdev->dev);
46+
if (WARN_ON(r < 0))
4847
return r;
49-
}
5048

5149
return 0;
5250
}

drivers/video/fbdev/omap2/omapfb/dss/venc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,9 @@ static int venc_runtime_get(void)
347347

348348
DSSDBG("venc_runtime_get\n");
349349

350-
r = pm_runtime_get_sync(&venc.pdev->dev);
351-
if (WARN_ON(r < 0)) {
352-
pm_runtime_put_sync(&venc.pdev->dev);
350+
r = pm_runtime_resume_and_get(&venc.pdev->dev);
351+
if (WARN_ON(r < 0))
353352
return r;
354-
}
355353
return 0;
356354
}
357355

0 commit comments

Comments
 (0)