diff options
author | Huang Ying <ying.huang@intel.com> | 2009-07-30 21:41:42 -0400 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2009-08-10 16:58:53 -0400 |
commit | 5be9ed251f58881dfc3dd6742a81ff9ad1a7bb04 (patch) | |
tree | 68daac9655764063657b0d66772542c82dd68e90 | |
parent | 0dcc66851f1091af421416c28a9458836885f522 (diff) |
x86, mce: Move debugfs mce dir creating to mce.c
Because more debugfs files under mce dir will be create in mce.c.
ChangeLog:
v5:
- Rebased on x86-tip.git/mce
Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-internal.h | 1 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-severity.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 13 |
3 files changed, 15 insertions, 3 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-internal.h b/arch/x86/kernel/cpu/mcheck/mce-internal.h index 6bd51e7ba87b..32996f9fab67 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-internal.h +++ b/arch/x86/kernel/cpu/mcheck/mce-internal.h | |||
@@ -22,6 +22,7 @@ struct mce_bank { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | int mce_severity(struct mce *a, int tolerant, char **msg); | 24 | int mce_severity(struct mce *a, int tolerant, char **msg); |
25 | struct dentry *mce_get_debugfs_dir(void); | ||
25 | 26 | ||
26 | extern int mce_ser; | 27 | extern int mce_ser; |
27 | 28 | ||
diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c index 51f7c725dab5..bc35a073d151 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-severity.c +++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c | |||
@@ -197,7 +197,7 @@ static int __init severities_debugfs_init(void) | |||
197 | { | 197 | { |
198 | struct dentry *dmce = NULL, *fseverities_coverage = NULL; | 198 | struct dentry *dmce = NULL, *fseverities_coverage = NULL; |
199 | 199 | ||
200 | dmce = debugfs_create_dir("mce", NULL); | 200 | dmce = mce_get_debugfs_dir(); |
201 | if (dmce == NULL) | 201 | if (dmce == NULL) |
202 | goto err_out; | 202 | goto err_out; |
203 | fseverities_coverage = debugfs_create_file("severities-coverage", | 203 | fseverities_coverage = debugfs_create_file("severities-coverage", |
@@ -209,8 +209,6 @@ static int __init severities_debugfs_init(void) | |||
209 | return 0; | 209 | return 0; |
210 | 210 | ||
211 | err_out: | 211 | err_out: |
212 | if (dmce) | ||
213 | debugfs_remove(dmce); | ||
214 | return -ENOMEM; | 212 | return -ENOMEM; |
215 | } | 213 | } |
216 | late_initcall(severities_debugfs_init); | 214 | late_initcall(severities_debugfs_init); |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 1ce6db1f8789..9c7419e459d6 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/smp.h> | 34 | #include <linux/smp.h> |
35 | #include <linux/fs.h> | 35 | #include <linux/fs.h> |
36 | #include <linux/mm.h> | 36 | #include <linux/mm.h> |
37 | #include <linux/debugfs.h> | ||
37 | 38 | ||
38 | #include <asm/processor.h> | 39 | #include <asm/processor.h> |
39 | #include <asm/hw_irq.h> | 40 | #include <asm/hw_irq.h> |
@@ -2003,3 +2004,15 @@ static int __init mcheck_disable(char *str) | |||
2003 | return 1; | 2004 | return 1; |
2004 | } | 2005 | } |
2005 | __setup("nomce", mcheck_disable); | 2006 | __setup("nomce", mcheck_disable); |
2007 | |||
2008 | #ifdef CONFIG_DEBUG_FS | ||
2009 | struct dentry *mce_get_debugfs_dir(void) | ||
2010 | { | ||
2011 | static struct dentry *dmce; | ||
2012 | |||
2013 | if (!dmce) | ||
2014 | dmce = debugfs_create_dir("mce", NULL); | ||
2015 | |||
2016 | return dmce; | ||
2017 | } | ||
2018 | #endif | ||