OSDN Git Service

drm/exynos: Use pm_runtime_resume_and_get() to replace open coding
authorTian Tao <tiantao6@hisilicon.com>
Mon, 24 May 2021 12:07:57 +0000 (20:07 +0800)
committerInki Dae <inki.dae@samsung.com>
Fri, 11 Jun 2021 01:56:27 +0000 (10:56 +0900)
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>
drivers/gpu/drm/exynos/exynos_drm_mic.c

index 3821ea7..32672bf 100644 (file)
@@ -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);