aboutsummaryrefslogtreecommitdiffstats
path: root/mm/cma_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/cma_debug.c')
-rw-r--r--mm/cma_debug.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mm/cma_debug.c b/mm/cma_debug.c
index b55f28fbe831..8d7b2fd52225 100644
--- a/mm/cma_debug.c
+++ b/mm/cma_debug.c
@@ -21,8 +21,6 @@ struct cma_mem {
21 unsigned long n; 21 unsigned long n;
22}; 22};
23 23
24static struct dentry *cma_debugfs_root;
25
26static int cma_debugfs_get(void *data, u64 *val) 24static int cma_debugfs_get(void *data, u64 *val)
27{ 25{
28 unsigned long *p = data; 26 unsigned long *p = data;
@@ -162,7 +160,7 @@ static int cma_alloc_write(void *data, u64 val)
162} 160}
163DEFINE_SIMPLE_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n"); 161DEFINE_SIMPLE_ATTRIBUTE(cma_alloc_fops, NULL, cma_alloc_write, "%llu\n");
164 162
165static void cma_debugfs_add_one(struct cma *cma, int idx) 163static void cma_debugfs_add_one(struct cma *cma, struct dentry *root_dentry)
166{ 164{
167 struct dentry *tmp; 165 struct dentry *tmp;
168 char name[16]; 166 char name[16];
@@ -170,7 +168,7 @@ static void cma_debugfs_add_one(struct cma *cma, int idx)
170 168
171 scnprintf(name, sizeof(name), "cma-%s", cma->name); 169 scnprintf(name, sizeof(name), "cma-%s", cma->name);
172 170
173 tmp = debugfs_create_dir(name, cma_debugfs_root); 171 tmp = debugfs_create_dir(name, root_dentry);
174 172
175 debugfs_create_file("alloc", 0200, tmp, cma, &cma_alloc_fops); 173 debugfs_create_file("alloc", 0200, tmp, cma, &cma_alloc_fops);
176 debugfs_create_file("free", 0200, tmp, cma, &cma_free_fops); 174 debugfs_create_file("free", 0200, tmp, cma, &cma_free_fops);
@@ -188,12 +186,13 @@ static void cma_debugfs_add_one(struct cma *cma, int idx)
188 186
189static int __init cma_debugfs_init(void) 187static int __init cma_debugfs_init(void)
190{ 188{
189 struct dentry *cma_debugfs_root;
191 int i; 190 int i;
192 191
193 cma_debugfs_root = debugfs_create_dir("cma", NULL); 192 cma_debugfs_root = debugfs_create_dir("cma", NULL);
194 193
195 for (i = 0; i < cma_area_count; i++) 194 for (i = 0; i < cma_area_count; i++)
196 cma_debugfs_add_one(&cma_areas[i], i); 195 cma_debugfs_add_one(&cma_areas[i], cma_debugfs_root);
197 196
198 return 0; 197 return 0;
199} 198}