Skip to content

Commit

Permalink
drm/exynos: Use pm_runtime_resume_and_get() to replace open coding
Browse files Browse the repository at this point in the history
use pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
pm_runtime_put_noidle to avoid continuing to increase the refcount
when pm_runtime_get_sync fails.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
  • Loading branch information
Tian Tao authored and Inki Dae committed Jun 11, 2021
1 parent c707b73 commit a89b6c8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/exynos/exynos_drm_mic.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,9 @@ static void mic_pre_enable(struct drm_bridge *bridge)
if (mic->enabled)
goto unlock;

ret = pm_runtime_get_sync(mic->dev);
if (ret < 0) {
pm_runtime_put_noidle(mic->dev);
ret = pm_runtime_resume_and_get(mic->dev);
if (ret < 0)
goto unlock;
}

mic_set_path(mic, 1);

Expand Down

0 comments on commit a89b6c8

Please sign in to comment.