]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86, mce: Move debugfs mce dir creating to mce.c
authorHuang Ying <ying.huang@intel.com>
Fri, 31 Jul 2009 01:41:42 +0000 (09:41 +0800)
committerH. Peter Anvin <hpa@zytor.com>
Mon, 10 Aug 2009 20:58:53 +0000 (13:58 -0700)
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>
arch/x86/kernel/cpu/mcheck/mce-internal.h
arch/x86/kernel/cpu/mcheck/mce-severity.c
arch/x86/kernel/cpu/mcheck/mce.c

index 6bd51e7ba87bab42e0211534b5dc72658d538ffa..32996f9fab670be274b925e7ec3a4bd52e8650c3 100644 (file)
@@ -22,6 +22,7 @@ struct mce_bank {
 };
 
 int mce_severity(struct mce *a, int tolerant, char **msg);
+struct dentry *mce_get_debugfs_dir(void);
 
 extern int mce_ser;
 
index 51f7c725dab5383a93a5ca2ce9bdf91256634d82..bc35a073d151242415fe0b59d549da704f2e7245 100644 (file)
@@ -197,7 +197,7 @@ static int __init severities_debugfs_init(void)
 {
        struct dentry *dmce = NULL, *fseverities_coverage = NULL;
 
-       dmce = debugfs_create_dir("mce", NULL);
+       dmce = mce_get_debugfs_dir();
        if (dmce == NULL)
                goto err_out;
        fseverities_coverage = debugfs_create_file("severities-coverage",
@@ -209,8 +209,6 @@ static int __init severities_debugfs_init(void)
        return 0;
 
 err_out:
-       if (dmce)
-               debugfs_remove(dmce);
        return -ENOMEM;
 }
 late_initcall(severities_debugfs_init);
index 1ce6db1f8789047f493b247083ea3d11366ba8b9..9c7419e459d6782c1b29bddeaae225c745fccf2c 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/smp.h>
 #include <linux/fs.h>
 #include <linux/mm.h>
+#include <linux/debugfs.h>
 
 #include <asm/processor.h>
 #include <asm/hw_irq.h>
@@ -2003,3 +2004,15 @@ static int __init mcheck_disable(char *str)
        return 1;
 }
 __setup("nomce", mcheck_disable);
+
+#ifdef CONFIG_DEBUG_FS
+struct dentry *mce_get_debugfs_dir(void)
+{
+       static struct dentry *dmce;
+
+       if (!dmce)
+               dmce = debugfs_create_dir("mce", NULL);
+
+       return dmce;
+}
+#endif