aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/edac/edac_module.c')
-rw-r--r--drivers/edac/edac_module.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c
index dc900ed75178..38e4a71380aa 100644
--- a/drivers/edac/edac_module.c
+++ b/drivers/edac/edac_module.c
@@ -35,6 +35,25 @@ static struct sysdev_class edac_class = {
35static int edac_class_valid = 0; 35static int edac_class_valid = 0;
36 36
37/* 37/*
38 * edac_op_state_toString()
39 */
40char * edac_op_state_toString(int opstate)
41{
42 if (opstate == OP_RUNNING_POLL)
43 return "POLLED";
44 else if (opstate == OP_RUNNING_INTERRUPT)
45 return "INTERRUPT";
46 else if (opstate == OP_RUNNING_POLL_INTR)
47 return "POLL-INTR";
48 else if (opstate == OP_ALLOC)
49 return "ALLOC";
50 else if (opstate == OP_OFFLINE)
51 return "OFFLINE";
52
53 return "UNKNOWN";
54}
55
56/*
38 * edac_get_edac_class() 57 * edac_get_edac_class()
39 * 58 *
40 * return pointer to the edac class of 'edac' 59 * return pointer to the edac class of 'edac'
@@ -153,26 +172,16 @@ static int __init edac_init(void)
153 goto error_sysfs; 172 goto error_sysfs;
154 } 173 }
155 174
156 /* Create the PCI parity sysfs entries */
157 if (edac_sysfs_pci_setup()) {
158 edac_printk(KERN_ERR, EDAC_MC,
159 "PCI: Error initializing sysfs code\n");
160 err = -ENODEV;
161 goto error_mem;
162 }
163
164 /* Setup/Initialize the edac_device system */ 175 /* Setup/Initialize the edac_device system */
165 err = edac_workqueue_setup(); 176 err = edac_workqueue_setup();
166 if (err) { 177 if (err) {
167 edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n"); 178 edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n");
168 goto error_pci; 179 goto error_mem;
169 } 180 }
170 181
171 return 0; 182 return 0;
172 183
173 /* Error teardown stack */ 184 /* Error teardown stack */
174error_pci:
175 edac_sysfs_pci_teardown();
176error_mem: 185error_mem:
177 edac_sysfs_memctrl_teardown(); 186 edac_sysfs_memctrl_teardown();
178error_sysfs: 187error_sysfs:
@@ -192,7 +201,6 @@ static void __exit edac_exit(void)
192 /* tear down the various subsystems*/ 201 /* tear down the various subsystems*/
193 edac_workqueue_teardown(); 202 edac_workqueue_teardown();
194 edac_sysfs_memctrl_teardown(); 203 edac_sysfs_memctrl_teardown();
195 edac_sysfs_pci_teardown();
196 edac_unregister_sysfs_edac_name(); 204 edac_unregister_sysfs_edac_name();
197} 205}
198 206