summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/debug_allocator.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-07-27 16:31:32 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-04 12:24:02 -0400
commit972c42fddf13f658242a4f92124e5fcf194672b3 (patch)
tree8b679b522be90f8980fb05d2641fbb9eaca768d6 /drivers/gpu/nvgpu/common/linux/debug_allocator.c
parentb8efd9d04537d6129e2ce8b067417e46b0e7436f (diff)
gpu: nvgpu: Move debugfs fields to os_linux
Move all Linux specific debugfs dentry fields to struct nvgpu_os_linux. JIRA NVGPU-62 Change-Id: I615620005f5d042943dd2e478c1629bcc912c550 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1528263 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/debug_allocator.c')
-rw-r--r--drivers/gpu/nvgpu/common/linux/debug_allocator.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/debug_allocator.c b/drivers/gpu/nvgpu/common/linux/debug_allocator.c
index dfc1dc41..6a0aa4c5 100644
--- a/drivers/gpu/nvgpu/common/linux/debug_allocator.c
+++ b/drivers/gpu/nvgpu/common/linux/debug_allocator.c
@@ -13,7 +13,6 @@
13 */ 13 */
14 14
15#include "debug_allocator.h" 15#include "debug_allocator.h"
16#include "gk20a/platform_gk20a.h"
17#include "os_linux.h" 16#include "os_linux.h"
18 17
19#include <linux/debugfs.h> 18#include <linux/debugfs.h>
@@ -52,11 +51,13 @@ static const struct file_operations __alloc_fops = {
52 51
53void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a) 52void nvgpu_init_alloc_debug(struct gk20a *g, struct nvgpu_allocator *a)
54{ 53{
55 if (!g->debugfs_allocators) 54 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
55
56 if (!l->debugfs_allocators)
56 return; 57 return;
57 58
58 a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO, 59 a->debugfs_entry = debugfs_create_file(a->name, S_IRUGO,
59 g->debugfs_allocators, 60 l->debugfs_allocators,
60 a, &__alloc_fops); 61 a, &__alloc_fops);
61} 62}
62 63
@@ -68,14 +69,14 @@ void nvgpu_fini_alloc_debug(struct nvgpu_allocator *a)
68 69
69void nvgpu_alloc_debugfs_init(struct gk20a *g) 70void nvgpu_alloc_debugfs_init(struct gk20a *g)
70{ 71{
71 struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); 72 struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g);
72 73
73 g->debugfs_allocators = debugfs_create_dir("allocators", platform->debugfs); 74 l->debugfs_allocators = debugfs_create_dir("allocators", l->debugfs);
74 if (IS_ERR_OR_NULL(g->debugfs_allocators)) { 75 if (IS_ERR_OR_NULL(l->debugfs_allocators)) {
75 g->debugfs_allocators = NULL; 76 l->debugfs_allocators = NULL;
76 return; 77 return;
77 } 78 }
78 79
79 debugfs_create_u32("tracing", 0664, g->debugfs_allocators, 80 debugfs_create_u32("tracing", 0664, l->debugfs_allocators,
80 &nvgpu_alloc_tracing_on); 81 &nvgpu_alloc_tracing_on);
81} 82}