|
@@ -26,15 +26,6 @@ EXPORT_SYMBOL_GPL(edac_debug_level);
|
|
|
/* scope is to module level only */
|
|
|
struct workqueue_struct *edac_workqueue;
|
|
|
|
|
|
-/*
|
|
|
- * sysfs object: /sys/devices/system/edac
|
|
|
- * need to export to other files in this modules
|
|
|
- */
|
|
|
-static struct sysdev_class edac_class = {
|
|
|
- .name = "edac",
|
|
|
-};
|
|
|
-static int edac_class_valid;
|
|
|
-
|
|
|
/*
|
|
|
* edac_op_state_to_string()
|
|
|
*/
|
|
@@ -54,60 +45,6 @@ char *edac_op_state_to_string(int opstate)
|
|
|
return "UNKNOWN";
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * edac_get_edac_class()
|
|
|
- *
|
|
|
- * return pointer to the edac class of 'edac'
|
|
|
- */
|
|
|
-struct sysdev_class *edac_get_edac_class(void)
|
|
|
-{
|
|
|
- struct sysdev_class *classptr = NULL;
|
|
|
-
|
|
|
- if (edac_class_valid)
|
|
|
- classptr = &edac_class;
|
|
|
-
|
|
|
- return classptr;
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * edac_register_sysfs_edac_name()
|
|
|
- *
|
|
|
- * register the 'edac' into /sys/devices/system
|
|
|
- *
|
|
|
- * return:
|
|
|
- * 0 success
|
|
|
- * !0 error
|
|
|
- */
|
|
|
-static int edac_register_sysfs_edac_name(void)
|
|
|
-{
|
|
|
- int err;
|
|
|
-
|
|
|
- /* create the /sys/devices/system/edac directory */
|
|
|
- err = sysdev_class_register(&edac_class);
|
|
|
-
|
|
|
- if (err) {
|
|
|
- debugf1("%s() error=%d\n", __func__, err);
|
|
|
- return err;
|
|
|
- }
|
|
|
-
|
|
|
- edac_class_valid = 1;
|
|
|
- return 0;
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * sysdev_class_unregister()
|
|
|
- *
|
|
|
- * unregister the 'edac' from /sys/devices/system
|
|
|
- */
|
|
|
-static void edac_unregister_sysfs_edac_name(void)
|
|
|
-{
|
|
|
- /* only if currently registered, then unregister it */
|
|
|
- if (edac_class_valid)
|
|
|
- sysdev_class_unregister(&edac_class);
|
|
|
-
|
|
|
- edac_class_valid = 0;
|
|
|
-}
|
|
|
-
|
|
|
/*
|
|
|
* edac_workqueue_setup
|
|
|
* initialize the edac work queue for polling operations
|
|
@@ -153,22 +90,12 @@ static int __init edac_init(void)
|
|
|
*/
|
|
|
edac_pci_clear_parity_errors();
|
|
|
|
|
|
- /*
|
|
|
- * perform the registration of the /sys/devices/system/edac class object
|
|
|
- */
|
|
|
- if (edac_register_sysfs_edac_name()) {
|
|
|
- edac_printk(KERN_ERR, EDAC_MC,
|
|
|
- "Error initializing 'edac' kobject\n");
|
|
|
- err = -ENODEV;
|
|
|
- goto error;
|
|
|
- }
|
|
|
-
|
|
|
/*
|
|
|
* now set up the mc_kset under the edac class object
|
|
|
*/
|
|
|
err = edac_sysfs_setup_mc_kset();
|
|
|
if (err)
|
|
|
- goto sysfs_setup_fail;
|
|
|
+ goto error;
|
|
|
|
|
|
/* Setup/Initialize the workq for this core */
|
|
|
err = edac_workqueue_setup();
|
|
@@ -183,9 +110,6 @@ static int __init edac_init(void)
|
|
|
workq_fail:
|
|
|
edac_sysfs_teardown_mc_kset();
|
|
|
|
|
|
-sysfs_setup_fail:
|
|
|
- edac_unregister_sysfs_edac_name();
|
|
|
-
|
|
|
error:
|
|
|
return err;
|
|
|
}
|
|
@@ -201,7 +125,6 @@ static void __exit edac_exit(void)
|
|
|
/* tear down the various subsystems */
|
|
|
edac_workqueue_teardown();
|
|
|
edac_sysfs_teardown_mc_kset();
|
|
|
- edac_unregister_sysfs_edac_name();
|
|
|
}
|
|
|
|
|
|
/*
|