diff options
author | Doug Thompson <dougthompson@xmission.com> | 2007-07-19 01:50:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 10:04:57 -0700 |
commit | 8096cfafbb7ad3cb1a286ae7e8086167f4ebb4b6 (patch) | |
tree | 27b859beffef019095db810244f93e10473ea06f /drivers/edac/edac_module.c | |
parent | d45e7823baf655ced91c7987fb4ba9aae990ad6d (diff) |
drivers/edac: fix edac_mc sysfs completion code
This patch refactors the 'releasing' of kobjects for the edac_mc type of
device. The correct pattern of kobject release is followed.
As internal kobjs are allocated they bump a ref count on the top level kobj.
It in turn has a module ref count on the edac_core module. When internal
kobjects are released, they dec the ref count on the top level kobj. When the
top level kobj reaches zero, it decrements the ref count on the edac_core
object, allow it to be unloaded, as all resources have all now been released.
Cc: Alan Cox alan@lxorguk.ukuu.org.uk
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac/edac_module.c')
-rw-r--r-- | drivers/edac/edac_module.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/edac/edac_module.c b/drivers/edac/edac_module.c index 07bd16564780..fc32bbb9405e 100644 --- a/drivers/edac/edac_module.c +++ b/drivers/edac/edac_module.c @@ -14,11 +14,11 @@ #include "edac_core.h" #include "edac_module.h" -#define EDAC_MC_VERSION "Ver: 2.0.4 " __DATE__ +#define EDAC_MC_VERSION "Ver: 2.0.5 " __DATE__ #ifdef CONFIG_EDAC_DEBUG /* Values of 0 to 4 will generate output */ -int edac_debug_level = 1; +int edac_debug_level = 2; EXPORT_SYMBOL_GPL(edac_debug_level); #endif @@ -153,7 +153,7 @@ static int __init edac_init(void) edac_pci_clear_parity_errors(); /* - * perform the registration of the /sys/devices/system/edac object + * perform the registration of the /sys/devices/system/edac class object */ if (edac_register_sysfs_edac_name()) { edac_printk(KERN_ERR, EDAC_MC, @@ -162,29 +162,29 @@ static int __init edac_init(void) goto error; } - /* Create the MC sysfs entries, must be first + /* + * now set up the mc_kset under the edac class object */ - if (edac_sysfs_memctrl_setup()) { - edac_printk(KERN_ERR, EDAC_MC, - "Error initializing sysfs code\n"); - err = -ENODEV; - goto error_sysfs; - } + err = edac_sysfs_setup_mc_kset(); + if (err) + goto sysfs_setup_fail; - /* Setup/Initialize the edac_device system */ + /* Setup/Initialize the workq for this core */ err = edac_workqueue_setup(); if (err) { edac_printk(KERN_ERR, EDAC_MC, "init WorkQueue failure\n"); - goto error_mem; + goto workq_fail; } return 0; /* Error teardown stack */ -error_mem: - edac_sysfs_memctrl_teardown(); -error_sysfs: +workq_fail: + edac_sysfs_teardown_mc_kset(); + +sysfs_setup_fail: edac_unregister_sysfs_edac_name(); + error: return err; } @@ -199,7 +199,7 @@ static void __exit edac_exit(void) /* tear down the various subsystems */ edac_workqueue_teardown(); - edac_sysfs_memctrl_teardown(); + edac_sysfs_teardown_mc_kset(); edac_unregister_sysfs_edac_name(); } |