From c27f99c62b24d67ebdcfda82587cb33e8a7bed43 Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Wed, 20 Jun 2007 10:54:19 +1000 Subject: [PATCH] --- yaml --- r: 60686 b: refs/heads/master c: 94a3807c2a547283bb2fb1728609ad51c09d5f79 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/prom.c | 9 +++------ trunk/arch/powerpc/kernel/setup-common.c | 13 +++++++++++++ trunk/include/asm-powerpc/system.h | 2 ++ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index b684013adff8..d1f8609b6baf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: db0dbae9d9680bce69fe1ce775709e60c8ee9c29 +refs/heads/master: 94a3807c2a547283bb2fb1728609ad51c09d5f79 diff --git a/trunk/arch/powerpc/kernel/prom.c b/trunk/arch/powerpc/kernel/prom.c index 6d5e601097a0..0782afc29f5f 100644 --- a/trunk/arch/powerpc/kernel/prom.c +++ b/trunk/arch/powerpc/kernel/prom.c @@ -52,6 +52,7 @@ #include #include #include +#include #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; diff --git a/trunk/arch/powerpc/kernel/setup-common.c b/trunk/arch/powerpc/kernel/setup-common.c index 38c4b733a72e..4924c48cb1ff 100644 --- a/trunk/arch/powerpc/kernel/setup-common.c +++ b/trunk/arch/powerpc/kernel/setup-common.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -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 diff --git a/trunk/include/asm-powerpc/system.h b/trunk/include/asm-powerpc/system.h index eff3de953712..32aa42b748be 100644 --- a/trunk/include/asm-powerpc/system.h +++ b/trunk/include/asm-powerpc/system.h @@ -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 */