aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/mce_amd_inj.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/edac/mce_amd_inj.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/edac/mce_amd_inj.c')
-rw-r--r--drivers/edac/mce_amd_inj.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/edac/mce_amd_inj.c b/drivers/edac/mce_amd_inj.c
index 2ae78f20cc2..a4987e03f59 100644
--- a/drivers/edac/mce_amd_inj.c
+++ b/drivers/edac/mce_amd_inj.c
@@ -6,14 +6,13 @@
6 * This file may be distributed under the terms of the GNU General Public 6 * This file may be distributed under the terms of the GNU General Public
7 * License version 2. 7 * License version 2.
8 * 8 *
9 * Copyright (c) 2010: Borislav Petkov <bp@alien8.de> 9 * Copyright (c) 2010: Borislav Petkov <borislav.petkov@amd.com>
10 * Advanced Micro Devices Inc. 10 * Advanced Micro Devices Inc.
11 */ 11 */
12 12
13#include <linux/kobject.h> 13#include <linux/kobject.h>
14#include <linux/device.h> 14#include <linux/sysdev.h>
15#include <linux/edac.h> 15#include <linux/edac.h>
16#include <linux/module.h>
17#include <asm/mce.h> 16#include <asm/mce.h>
18 17
19#include "mce_amd.h" 18#include "mce_amd.h"
@@ -116,14 +115,14 @@ static struct edac_mce_attr *sysfs_attrs[] = { &mce_attr_status, &mce_attr_misc,
116 115
117static int __init edac_init_mce_inject(void) 116static int __init edac_init_mce_inject(void)
118{ 117{
119 struct bus_type *edac_subsys = NULL; 118 struct sysdev_class *edac_class = NULL;
120 int i, err = 0; 119 int i, err = 0;
121 120
122 edac_subsys = edac_get_sysfs_subsys(); 121 edac_class = edac_get_sysfs_class();
123 if (!edac_subsys) 122 if (!edac_class)
124 return -EINVAL; 123 return -EINVAL;
125 124
126 mce_kobj = kobject_create_and_add("mce", &edac_subsys->dev_root->kobj); 125 mce_kobj = kobject_create_and_add("mce", &edac_class->kset.kobj);
127 if (!mce_kobj) { 126 if (!mce_kobj) {
128 printk(KERN_ERR "Error creating a mce kset.\n"); 127 printk(KERN_ERR "Error creating a mce kset.\n");
129 err = -ENOMEM; 128 err = -ENOMEM;
@@ -147,7 +146,7 @@ err_sysfs_create:
147 kobject_del(mce_kobj); 146 kobject_del(mce_kobj);
148 147
149err_mce_kobj: 148err_mce_kobj:
150 edac_put_sysfs_subsys(); 149 edac_put_sysfs_class();
151 150
152 return err; 151 return err;
153} 152}
@@ -161,13 +160,13 @@ static void __exit edac_exit_mce_inject(void)
161 160
162 kobject_del(mce_kobj); 161 kobject_del(mce_kobj);
163 162
164 edac_put_sysfs_subsys(); 163 edac_put_sysfs_class();
165} 164}
166 165
167module_init(edac_init_mce_inject); 166module_init(edac_init_mce_inject);
168module_exit(edac_exit_mce_inject); 167module_exit(edac_exit_mce_inject);
169 168
170MODULE_LICENSE("GPL"); 169MODULE_LICENSE("GPL");
171MODULE_AUTHOR("Borislav Petkov <bp@alien8.de>"); 170MODULE_AUTHOR("Borislav Petkov <borislav.petkov@amd.com>");
172MODULE_AUTHOR("AMD Inc."); 171MODULE_AUTHOR("AMD Inc.");
173MODULE_DESCRIPTION("MCE injection facility for testing MCE decoding"); 172MODULE_DESCRIPTION("MCE injection facility for testing MCE decoding");