aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2010-09-23 15:04:26 -0400
committerPaul Mundt <lethal@linux-sh.org>2010-09-23 15:04:26 -0400
commit3f224f4e057ce67713f3e7a8890f2fbe12d047a5 (patch)
treebcaa45b4a0095c4c502ffac056e26481a7b49442 /arch
parenta234ca0faa65dcd5cc473915bd925130ebb7b74b (diff)
sh: provide generic arch_debugfs_dir.
While sh previously had its own debugfs root, there now exists a common arch_debugfs_dir prototype, so we switch everything over to that. Presumably once more architectures start making use of this we'll be able to just kill off the stub kdebugfs wrapper. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/include/asm/system.h2
-rw-r--r--arch/sh/kernel/Makefile4
-rw-r--r--arch/sh/kernel/kdebugfs.c16
-rw-r--r--arch/sh/kernel/setup.c15
-rw-r--r--arch/sh/mm/asids-debugfs.c2
-rw-r--r--arch/sh/mm/cache-debugfs.c10
-rw-r--r--arch/sh/mm/pmb.c4
-rw-r--r--arch/sh/mm/tlb-debugfs.c11
8 files changed, 24 insertions, 40 deletions
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index 0bd7a17d5e1a..1f1af5afff03 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -140,8 +140,6 @@ extern unsigned int instruction_size(unsigned int insn);
140extern unsigned long cached_to_uncached; 140extern unsigned long cached_to_uncached;
141extern unsigned long uncached_size; 141extern unsigned long uncached_size;
142 142
143extern struct dentry *sh_debugfs_root;
144
145void per_cpu_trap_init(void); 143void per_cpu_trap_init(void);
146void default_idle(void); 144void default_idle(void);
147void cpu_idle_wait(void); 145void cpu_idle_wait(void);
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile
index a1effb673722..8eed6a485446 100644
--- a/arch/sh/kernel/Makefile
+++ b/arch/sh/kernel/Makefile
@@ -12,8 +12,8 @@ endif
12CFLAGS_REMOVE_return_address.o = -pg 12CFLAGS_REMOVE_return_address.o = -pg
13 13
14obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \ 14obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \
15 idle.o io.o irq.o \ 15 idle.o io.o irq.o irq_$(BITS).o kdebugfs.o \
16 irq_$(BITS).o machvec.o nmi_debug.o process.o \ 16 machvec.o nmi_debug.o process.o \
17 process_$(BITS).o ptrace.o ptrace_$(BITS).o \ 17 process_$(BITS).o ptrace.o ptrace_$(BITS).o \
18 reboot.o return_address.o \ 18 reboot.o return_address.o \
19 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \ 19 setup.o signal_$(BITS).o sys_sh.o sys_sh$(BITS).o \
diff --git a/arch/sh/kernel/kdebugfs.c b/arch/sh/kernel/kdebugfs.c
new file mode 100644
index 000000000000..e11c30bb100c
--- /dev/null
+++ b/arch/sh/kernel/kdebugfs.c
@@ -0,0 +1,16 @@
1#include <linux/module.h>
2#include <linux/init.h>
3#include <linux/debugfs.h>
4
5struct dentry *arch_debugfs_dir;
6EXPORT_SYMBOL(arch_debugfs_dir);
7
8static int __init arch_kdebugfs_init(void)
9{
10 arch_debugfs_dir = debugfs_create_dir("sh", NULL);
11 if (!arch_debugfs_dir)
12 return -ENOMEM;
13
14 return 0;
15}
16arch_initcall(arch_kdebugfs_init);
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index e769401a78ba..f24d0ea8be2d 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -24,7 +24,6 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/smp.h> 25#include <linux/smp.h>
26#include <linux/err.h> 26#include <linux/err.h>
27#include <linux/debugfs.h>
28#include <linux/crash_dump.h> 27#include <linux/crash_dump.h>
29#include <linux/mmzone.h> 28#include <linux/mmzone.h>
30#include <linux/clk.h> 29#include <linux/clk.h>
@@ -458,17 +457,3 @@ const struct seq_operations cpuinfo_op = {
458 .show = show_cpuinfo, 457 .show = show_cpuinfo,
459}; 458};
460#endif /* CONFIG_PROC_FS */ 459#endif /* CONFIG_PROC_FS */
461
462struct dentry *sh_debugfs_root;
463
464static int __init sh_debugfs_init(void)
465{
466 sh_debugfs_root = debugfs_create_dir("sh", NULL);
467 if (!sh_debugfs_root)
468 return -ENOMEM;
469 if (IS_ERR(sh_debugfs_root))
470 return PTR_ERR(sh_debugfs_root);
471
472 return 0;
473}
474arch_initcall(sh_debugfs_init);
diff --git a/arch/sh/mm/asids-debugfs.c b/arch/sh/mm/asids-debugfs.c
index cd8c3bf39b5a..74c03ecc4871 100644
--- a/arch/sh/mm/asids-debugfs.c
+++ b/arch/sh/mm/asids-debugfs.c
@@ -63,7 +63,7 @@ static int __init asids_debugfs_init(void)
63{ 63{
64 struct dentry *asids_dentry; 64 struct dentry *asids_dentry;
65 65
66 asids_dentry = debugfs_create_file("asids", S_IRUSR, sh_debugfs_root, 66 asids_dentry = debugfs_create_file("asids", S_IRUSR, arch_debugfs_dir,
67 NULL, &asids_debugfs_fops); 67 NULL, &asids_debugfs_fops);
68 if (!asids_dentry) 68 if (!asids_dentry)
69 return -ENOMEM; 69 return -ENOMEM;
diff --git a/arch/sh/mm/cache-debugfs.c b/arch/sh/mm/cache-debugfs.c
index 690ed010d002..52411462c409 100644
--- a/arch/sh/mm/cache-debugfs.c
+++ b/arch/sh/mm/cache-debugfs.c
@@ -126,25 +126,19 @@ static int __init cache_debugfs_init(void)
126{ 126{
127 struct dentry *dcache_dentry, *icache_dentry; 127 struct dentry *dcache_dentry, *icache_dentry;
128 128
129 dcache_dentry = debugfs_create_file("dcache", S_IRUSR, sh_debugfs_root, 129 dcache_dentry = debugfs_create_file("dcache", S_IRUSR, arch_debugfs_dir,
130 (unsigned int *)CACHE_TYPE_DCACHE, 130 (unsigned int *)CACHE_TYPE_DCACHE,
131 &cache_debugfs_fops); 131 &cache_debugfs_fops);
132 if (!dcache_dentry) 132 if (!dcache_dentry)
133 return -ENOMEM; 133 return -ENOMEM;
134 if (IS_ERR(dcache_dentry))
135 return PTR_ERR(dcache_dentry);
136 134
137 icache_dentry = debugfs_create_file("icache", S_IRUSR, sh_debugfs_root, 135 icache_dentry = debugfs_create_file("icache", S_IRUSR, arch_debugfs_dir,
138 (unsigned int *)CACHE_TYPE_ICACHE, 136 (unsigned int *)CACHE_TYPE_ICACHE,
139 &cache_debugfs_fops); 137 &cache_debugfs_fops);
140 if (!icache_dentry) { 138 if (!icache_dentry) {
141 debugfs_remove(dcache_dentry); 139 debugfs_remove(dcache_dentry);
142 return -ENOMEM; 140 return -ENOMEM;
143 } 141 }
144 if (IS_ERR(icache_dentry)) {
145 debugfs_remove(dcache_dentry);
146 return PTR_ERR(icache_dentry);
147 }
148 142
149 return 0; 143 return 0;
150} 144}
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c
index 6379091a1647..233c011c4d22 100644
--- a/arch/sh/mm/pmb.c
+++ b/arch/sh/mm/pmb.c
@@ -866,11 +866,9 @@ static int __init pmb_debugfs_init(void)
866 struct dentry *dentry; 866 struct dentry *dentry;
867 867
868 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO, 868 dentry = debugfs_create_file("pmb", S_IFREG | S_IRUGO,
869 sh_debugfs_root, NULL, &pmb_debugfs_fops); 869 arch_debugfs_dir, NULL, &pmb_debugfs_fops);
870 if (!dentry) 870 if (!dentry)
871 return -ENOMEM; 871 return -ENOMEM;
872 if (IS_ERR(dentry))
873 return PTR_ERR(dentry);
874 872
875 return 0; 873 return 0;
876} 874}
diff --git a/arch/sh/mm/tlb-debugfs.c b/arch/sh/mm/tlb-debugfs.c
index 229bf75f28df..dea637a09246 100644
--- a/arch/sh/mm/tlb-debugfs.c
+++ b/arch/sh/mm/tlb-debugfs.c
@@ -151,15 +151,13 @@ static int __init tlb_debugfs_init(void)
151{ 151{
152 struct dentry *itlb, *utlb; 152 struct dentry *itlb, *utlb;
153 153
154 itlb = debugfs_create_file("itlb", S_IRUSR, sh_debugfs_root, 154 itlb = debugfs_create_file("itlb", S_IRUSR, arch_debugfs_dir,
155 (unsigned int *)TLB_TYPE_ITLB, 155 (unsigned int *)TLB_TYPE_ITLB,
156 &tlb_debugfs_fops); 156 &tlb_debugfs_fops);
157 if (unlikely(!itlb)) 157 if (unlikely(!itlb))
158 return -ENOMEM; 158 return -ENOMEM;
159 if (IS_ERR(itlb))
160 return PTR_ERR(itlb);
161 159
162 utlb = debugfs_create_file("utlb", S_IRUSR, sh_debugfs_root, 160 utlb = debugfs_create_file("utlb", S_IRUSR, arch_debugfs_dir,
163 (unsigned int *)TLB_TYPE_UTLB, 161 (unsigned int *)TLB_TYPE_UTLB,
164 &tlb_debugfs_fops); 162 &tlb_debugfs_fops);
165 if (unlikely(!utlb)) { 163 if (unlikely(!utlb)) {
@@ -167,11 +165,6 @@ static int __init tlb_debugfs_init(void)
167 return -ENOMEM; 165 return -ENOMEM;
168 } 166 }
169 167
170 if (IS_ERR(utlb)) {
171 debugfs_remove(itlb);
172 return PTR_ERR(utlb);
173 }
174
175 return 0; 168 return 0;
176} 169}
177module_init(tlb_debugfs_init); 170module_init(tlb_debugfs_init);