aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-06-19 20:54:19 -0400
committerPaul Mackerras <paulus@samba.org>2007-07-10 07:53:50 -0400
commit94a3807c2a547283bb2fb1728609ad51c09d5f79 (patch)
treed85fa4f63da7ccacaeaa1688718439c6741f1d56 /arch
parentdb0dbae9d9680bce69fe1ce775709e60c8ee9c29 (diff)
[POWERPC] Make the debugfs "powerpc" dir globally accessible
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/prom.c9
-rw-r--r--arch/powerpc/kernel/setup-common.c13
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6d5e601097a0..0782afc29f5f 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -52,6 +52,7 @@
52#include <asm/pSeries_reconfig.h> 52#include <asm/pSeries_reconfig.h>
53#include <asm/pci-bridge.h> 53#include <asm/pci-bridge.h>
54#include <asm/kexec.h> 54#include <asm/kexec.h>
55#include <asm/system.h>
55 56
56#ifdef DEBUG 57#ifdef DEBUG
57#define DBG(fmt...) printk(KERN_ERR fmt) 58#define DBG(fmt...) printk(KERN_ERR fmt)
@@ -1730,22 +1731,18 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
1730} 1731}
1731EXPORT_SYMBOL(of_get_cpu_node); 1732EXPORT_SYMBOL(of_get_cpu_node);
1732 1733
1733#ifdef DEBUG 1734#if defined(CONFIG_DEBUG_FS) && defined(DEBUG)
1734static struct debugfs_blob_wrapper flat_dt_blob; 1735static struct debugfs_blob_wrapper flat_dt_blob;
1735 1736
1736static int __init export_flat_device_tree(void) 1737static int __init export_flat_device_tree(void)
1737{ 1738{
1738 struct dentry *d; 1739 struct dentry *d;
1739 1740
1740 d = debugfs_create_dir("powerpc", NULL);
1741 if (!d)
1742 return 1;
1743
1744 flat_dt_blob.data = initial_boot_params; 1741 flat_dt_blob.data = initial_boot_params;
1745 flat_dt_blob.size = initial_boot_params->totalsize; 1742 flat_dt_blob.size = initial_boot_params->totalsize;
1746 1743
1747 d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR, 1744 d = debugfs_create_blob("flat-device-tree", S_IFREG | S_IRUSR,
1748 d, &flat_dt_blob); 1745 powerpc_debugfs_root, &flat_dt_blob);
1749 if (!d) 1746 if (!d)
1750 return 1; 1747 return 1;
1751 1748
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 38c4b733a72e..4924c48cb1ff 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -32,6 +32,7 @@
32#include <linux/unistd.h> 32#include <linux/unistd.h>
33#include <linux/serial.h> 33#include <linux/serial.h>
34#include <linux/serial_8250.h> 34#include <linux/serial_8250.h>
35#include <linux/debugfs.h>
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/prom.h> 37#include <asm/prom.h>
37#include <asm/processor.h> 38#include <asm/processor.h>
@@ -579,3 +580,15 @@ static int __init check_cache_coherency(void)
579 580
580late_initcall(check_cache_coherency); 581late_initcall(check_cache_coherency);
581#endif /* CONFIG_CHECK_CACHE_COHERENCY */ 582#endif /* CONFIG_CHECK_CACHE_COHERENCY */
583
584#ifdef CONFIG_DEBUG_FS
585struct dentry *powerpc_debugfs_root;
586
587static int powerpc_debugfs_init(void)
588{
589 powerpc_debugfs_root = debugfs_create_dir("powerpc", NULL);
590
591 return powerpc_debugfs_root == NULL;
592}
593arch_initcall(powerpc_debugfs_init);
594#endif