diff options
author | Inki Dae <inki.dae@samsung.com> | 2021-05-25 12:51:39 +0200 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2021-06-11 03:56:38 +0200 |
commit | 445d3bed75de4082c7c7794030ac9a5b8bfde886 (patch) | |
tree | ab67883b8eeff4d2dba8f276f893bb70abae52c5 /drivers/gpu/drm/exynos/exynos7_drm_decon.c | |
parent | drm/exynos: Use pm_runtime_resume_and_get() to replace open coding (diff) | |
download | linux-445d3bed75de4082c7c7794030ac9a5b8bfde886.tar.xz linux-445d3bed75de4082c7c7794030ac9a5b8bfde886.zip |
drm/exynos: use pm_runtime_resume_and_get()
Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
to deal with usage counter. pm_runtime_get_sync() increases the
usage counter even when it failed, which makes callers to forget
to decrease the usage counter and resulted in reference leak.
pm_runtime_resume_and_get() function decreases the usage counter
when it failed internally so it can avoid the reference leak.
Changelog v1:
- Fix an build error reported by kernel test robot of Intel.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reported-by: kernel test robot <lkp@intel.com>
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos7_drm_decon.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos7_drm_decon.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos7_drm_decon.c b/drivers/gpu/drm/exynos/exynos7_drm_decon.c index 9b5e6f94e558..12571ac45540 100644 --- a/drivers/gpu/drm/exynos/exynos7_drm_decon.c +++ b/drivers/gpu/drm/exynos/exynos7_drm_decon.c @@ -531,11 +531,16 @@ static void decon_init(struct decon_context *ctx) static void decon_atomic_enable(struct exynos_drm_crtc *crtc) { struct decon_context *ctx = crtc->ctx; + int ret; if (!ctx->suspended) return; - pm_runtime_get_sync(ctx->dev); + ret = pm_runtime_resume_and_get(ctx->dev); + if (ret < 0) { + DRM_DEV_ERROR(ctx->dev, "failed to enable DECON device.\n"); + return; + } decon_init(ctx); |