diff options
author | Jordan Crouse <jcrouse@codeaurora.org> | 2017-11-21 22:40:51 +0300 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2018-01-10 16:58:41 +0300 |
commit | aa2a2ab7b714f7b2de3849ca3379818ae15f476b (patch) | |
tree | 27757c2ab47aa1b95422ab2ec1cc98f59c54a733 /drivers/gpu | |
parent | 9dcfbc182f1aac0aa5ea194733d21e67dd2ba1fd (diff) | |
download | linux-aa2a2ab7b714f7b2de3849ca3379818ae15f476b.tar.xz |
drm/msm/adreno: Call dev_pm_opp_put()
We need to call dev_pm_opp_put() to put back the reference
for the OPP struct after calling the various dev_pm_opp_get_*
functions.
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/msm/adreno/a5xx_power.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/msm/adreno/adreno_device.c | 4 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/msm/adreno/a5xx_power.c b/drivers/gpu/drm/msm/adreno/a5xx_power.c index e5700bbf09dd..4e4d965fd9ab 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_power.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_power.c @@ -103,10 +103,16 @@ static inline uint32_t _get_mvolts(struct msm_gpu *gpu, uint32_t freq) struct msm_drm_private *priv = dev->dev_private; struct platform_device *pdev = priv->gpu_pdev; struct dev_pm_opp *opp; + u32 ret = 0; opp = dev_pm_opp_find_freq_exact(&pdev->dev, freq, true); - return (!IS_ERR(opp)) ? dev_pm_opp_get_voltage(opp) / 1000 : 0; + if (!IS_ERR(opp)) { + ret = dev_pm_opp_get_voltage(opp) / 1000; + dev_pm_opp_put(opp); + } + + return ret; } /* Setup thermal limit management */ diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index c30bd24bc92c..5845e43521f7 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -247,8 +247,10 @@ static int adreno_get_pwrlevels(struct device *dev, /* Find the fastest defined rate */ opp = dev_pm_opp_find_freq_floor(dev, &freq); - if (!IS_ERR(opp)) + if (!IS_ERR(opp)) { config->fast_rate = dev_pm_opp_get_freq(opp); + dev_pm_opp_put(opp); + } if (!config->fast_rate) { DRM_DEV_INFO(dev, |