diff options
author | Dmitry Pervushin <dpervushin@nvidia.com> | 2019-02-15 11:14:35 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-03-11 14:00:46 -0400 |
commit | 4269d56d02db3278270e8d49d3ec402f5a0a1189 (patch) | |
tree | 1fc03106cf45439646b349074947c572e8a90c0c /drivers/gpu/nvgpu/os/linux | |
parent | 7c8d212b503bf9b0412afce25a038d0b7945d487 (diff) |
nvgpu: more changes to clean loading/unloading
Bug 200487652
Change-Id: Ib52cc6a85a19ea0396c8ab584c5ce9970f93085a
Signed-off-by: Dmitry Pervushin <dpervushin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020386
(cherry picked from commit 617dff478c3687a08ed5b77f4ac2073b290c57ea)
Reviewed-on: https://git-master.nvidia.com/r/2035720
GVS: Gerrit_Virtual_Submit
Reviewed-by: Rahul Jain (SW-TEGRA) <rahuljain@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/scale.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index d7a961c7..ee5b6861 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c | |||
@@ -368,11 +368,11 @@ void gk20a_scale_init(struct device *dev) | |||
368 | profile->devfreq_profile.get_cur_freq = get_cur_freq; | 368 | profile->devfreq_profile.get_cur_freq = get_cur_freq; |
369 | profile->devfreq_profile.polling_ms = 25; | 369 | profile->devfreq_profile.polling_ms = 25; |
370 | 370 | ||
371 | devfreq = devfreq_add_device(dev, | 371 | devfreq = devm_devfreq_add_device(dev, |
372 | &profile->devfreq_profile, | 372 | &profile->devfreq_profile, |
373 | platform->devfreq_governor, NULL); | 373 | platform->devfreq_governor, NULL); |
374 | 374 | ||
375 | if (IS_ERR(devfreq)) | 375 | if (IS_ERR_OR_NULL(devfreq)) |
376 | devfreq = NULL; | 376 | devfreq = NULL; |
377 | 377 | ||
378 | l->devfreq = devfreq; | 378 | l->devfreq = devfreq; |
@@ -401,8 +401,6 @@ void gk20a_scale_exit(struct device *dev) | |||
401 | { | 401 | { |
402 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 402 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
403 | struct gk20a *g = platform->g; | 403 | struct gk20a *g = platform->g; |
404 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | ||
405 | int err; | ||
406 | 404 | ||
407 | #ifdef CONFIG_GK20A_PM_QOS | 405 | #ifdef CONFIG_GK20A_PM_QOS |
408 | if (platform->qos_notify) { | 406 | if (platform->qos_notify) { |
@@ -413,11 +411,6 @@ void gk20a_scale_exit(struct device *dev) | |||
413 | } | 411 | } |
414 | #endif | 412 | #endif |
415 | 413 | ||
416 | if (platform->devfreq_governor) { | ||
417 | err = devfreq_remove_device(l->devfreq); | ||
418 | l->devfreq = NULL; | ||
419 | } | ||
420 | |||
421 | nvgpu_kfree(g, g->scale_profile); | 414 | nvgpu_kfree(g, g->scale_profile); |
422 | g->scale_profile = NULL; | 415 | g->scale_profile = NULL; |
423 | } | 416 | } |