summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/debug_allocator.c
diff options
context:
space:
mode:
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}