diff options
author | Inki Dae <inki.dae@samsung.com> | 2021-05-25 19:51:39 +0900 |
---|---|---|
committer | Inki Dae <inki.dae@samsung.com> | 2021-06-11 10:56:38 +0900 |
commit | 445d3bed75de4082c7c7794030ac9a5b8bfde886 (patch) | |
tree | ab67883b8eeff4d2dba8f276f893bb70abae52c5 /drivers/gpu/drm/exynos/exynos_hdmi.c | |
parent | a89b6c8f86b9ae245558572b5247dc8ff10f2fe8 (diff) |
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/exynos_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/exynos/exynos_hdmi.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 39fa5d3b01ef..f893731d6021 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -1483,10 +1483,16 @@ static void hdmi_set_refclk(struct hdmi_context *hdata, bool on) /* Should be called with hdata->mutex mutex held. */ static void hdmiphy_enable(struct hdmi_context *hdata) { + int ret; + if (hdata->powered) return; - pm_runtime_get_sync(hdata->dev); + ret = pm_runtime_resume_and_get(hdata->dev); + if (ret < 0) { + dev_err(hdata->dev, "failed to enable HDMIPHY device.\n"); + return; + } if (regulator_bulk_enable(ARRAY_SIZE(supply), hdata->regul_bulk)) DRM_DEV_DEBUG_KMS(hdata->dev, |