From e99b59d14a03a6b35aef5e51b5ba9ea09708b2ea Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 5 Nov 2014 18:18:52 +0200 Subject: gpu: nvgpu: add gk20a_scale_exit() When removing the module, remove the device from devfreq and free resources allocated when scaling is initialized. Bug 1476801 Change-Id: I7bb0f8112a5bf7e5ce2fc56cf8af7059d910002c Signed-off-by: Konsta Holtta Reviewed-on: http://git-master/r/594444 Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a_scale.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a_scale.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c index d09a18f8..7efd07bf 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_scale.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_scale.c @@ -312,6 +312,28 @@ err_get_freqs: g->scale_profile = NULL; } +void gk20a_scale_exit(struct platform_device *pdev) +{ + struct gk20a_platform *platform = platform_get_drvdata(pdev); + struct gk20a *g = platform->g; + int err; + + if (platform->qos_id < PM_QOS_NUM_CLASSES && + platform->qos_id != PM_QOS_RESERVED && + platform->postscale) { + pm_qos_remove_notifier(platform->qos_id, + &g->scale_profile->qos_notify_block); + } + + if (platform->devfreq_governor) { + err = devfreq_remove_device(g->devfreq); + g->devfreq = NULL; + } + + kfree(g->scale_profile); + g->scale_profile = NULL; +} + /* * gk20a_scale_hw_init(dev) * -- cgit v1.2.2