]> git.karo-electronics.de Git - linux-beck.git/commitdiff
[POWERPC] Make the debugfs "powerpc" dir globally accessible
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 20 Jun 2007 00:54:19 +0000 (10:54 +1000)
committerPaul Mackerras <paulus@samba.org>
Tue, 10 Jul 2007 11:53:50 +0000 (21:53 +1000)
The prom.c debugging code creates a "powerpc" directory in debugfs,
which is nice, but doesn't allow any other debugging code to stick things
under "powerpc" in debugfs. So make it global.

While we're there we should make the prom.c debugging code depend on
CONFIG_DEBUG_FS, because it doesn't work otherwise.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/prom.c
arch/powerpc/kernel/setup-common.c
include/asm-powerpc/system.h

index 6d5e601097a0df33f65e4fca29144719915e6541..0782afc29f5f9e5d78e9eafcbebeb76de7f660cc 100644 (file)
@@ -52,6 +52,7 @@
 #include <asm/pSeries_reconfig.h>
 #include <asm/pci-bridge.h>
 #include <asm/kexec.h>
+#include <asm/system.h>
 
 #ifdef DEBUG
 #define DBG(fmt...) printk(KERN_ERR fmt)
@@ -1730,22 +1731,18 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
 }
 EXPORT_SYMBOL(of_get_cpu_node);
 
-#ifdef DEBUG
+#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
 static struct debugfs_blob_wrapper flat_dt_blob;
 
 static int __init export_flat_device_tree(void)
 {
        struct dentry *d;
 
-       d = debugfs_create_dir("powerpc", NULL);
-       if (!d)
-               return 1;
-
        flat_dt_blob.data = initial_boot_params;
        flat_dt_blob.size = initial_boot_params->totalsize;
 
        d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
-                               d, &flat_dt_blob);
+                               powerpc_debugfs_root, &flat_dt_blob);
        if (!d)
                return 1;
 
index 38c4b733a72e53104079f4370b6301b6ac7f4e28..4924c48cb1ffc64df621b6d2dd6790c2b0683100 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/unistd.h>
 #include <linux/serial.h>
 #include <linux/serial_8250.h>
+#include <linux/debugfs.h>
 #include <asm/io.h>
 #include <asm/prom.h>
 #include <asm/processor.h>
@@ -579,3 +580,15 @@ static int __init check_cache_coherency(void)
 
 late_initcall(check_cache_coherency);
 #endif /* CONFIG_CHECK_CACHE_COHERENCY */
+
+#ifdef CONFIG_DEBUG_FS
+struct dentry *powerpc_debugfs_root;
+
+static int powerpc_debugfs_init(void)
+{
+       powerpc_debugfs_root = debugfs_create_dir("powerpc", NULL);
+
+       return powerpc_debugfs_root == NULL;
+}
+arch_initcall(powerpc_debugfs_init);
+#endif
index eff3de953712f0be27a0c6245c2f11504ba700fa..32aa42b748bedbe90200d27ae1003f467c3ef5db 100644 (file)
@@ -559,5 +559,7 @@ static inline void create_function_call(unsigned long addr, void * func)
 extern void account_system_vtime(struct task_struct *);
 #endif
 
+extern struct dentry *powerpc_debugfs_root;
+
 #endif /* __KERNEL__ */
 #endif /* _ASM_POWERPC_SYSTEM_H */