summaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_pci_sysfs.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2015-11-27 11:40:43 +0100
committerBorislav Petkov <bp@suse.de>2015-12-11 16:56:39 +0100
commit733476cf207faf574b132523ff2aee78b488ed6b (patch)
treef0d455a00d75370ae2bfef8572ade0c73e748f9c /drivers/edac/edac_pci_sysfs.c
parentfcd5c4dd8201595d4c598c9cca5e54760277d687 (diff)
downloadlinux-733476cf207faf574b132523ff2aee78b488ed6b.tar.gz
linux-733476cf207faf574b132523ff2aee78b488ed6b.tar.bz2
linux-733476cf207faf574b132523ff2aee78b488ed6b.zip
EDAC: Rip out the edac_subsys reference counting
This was really dumb - reference counting for the main EDAC sysfs object. While we could've simply registered it as the first thing in the module init path and then hand it around to what needs it. Do that and rip out all the code around it, thus simplifying the whole handling significantly. Move the edac_subsys node back to edac_module.c. Signed-off-by: Borislav Petkov <bp@suse.de>
Diffstat (limited to 'drivers/edac/edac_pci_sysfs.c')
-rw-r--r--drivers/edac/edac_pci_sysfs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index 24d877f6e577..262f56cca9ff 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -364,7 +364,7 @@ static int edac_pci_main_kobj_setup(void)
if (!try_module_get(THIS_MODULE)) {
edac_dbg(1, "try_module_get() failed\n");
err = -ENODEV;
- goto mod_get_fail;
+ goto decrement_count_fail;
}
edac_pci_top_main_kobj = kzalloc(sizeof(struct kobject), GFP_KERNEL);
@@ -399,9 +399,6 @@ kobject_init_and_add_fail:
kzalloc_fail:
module_put(THIS_MODULE);
-mod_get_fail:
- edac_put_sysfs_subsys();
-
decrement_count_fail:
/* if are on this error exit, nothing to tear down */
atomic_dec(&edac_pci_sysfs_refcount);
@@ -426,7 +423,6 @@ static void edac_pci_main_kobj_teardown(void)
if (atomic_dec_return(&edac_pci_sysfs_refcount) == 0) {
edac_dbg(0, "called kobject_put on main kobj\n");
kobject_put(edac_pci_top_main_kobj);
- edac_put_sysfs_subsys();
}
}