aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-12-20 11:13:05 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:40 -0500
commit78a2d906b40fe530ea800c1e873bfe8f02326f1e (patch)
treeebeef35150816fa807f71e596a9aaf711ad10a90
parent197b12d6796a3bca187f22a8978a33d51e2bcd79 (diff)
Kobject: convert remaining kobject_unregister() to kobject_put()
There is no need for kobject_unregister() anymore, thanks to Kay's kobject cleanup changes, so replace all instances of it with kobject_put(). Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--kernel/ksysfs.c2
-rw-r--r--kernel/module.c9
-rw-r--r--lib/kobject.c4
-rw-r--r--net/bridge/br_sysfs_br.c2
-rw-r--r--security/inode.c2
5 files changed, 9 insertions, 10 deletions
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c
index 1081aff5fb9e..e53bc30e9ba5 100644
--- a/kernel/ksysfs.c
+++ b/kernel/ksysfs.c
@@ -154,7 +154,7 @@ notes_exit:
154group_exit: 154group_exit:
155 sysfs_remove_group(kernel_kobj, &kernel_attr_group); 155 sysfs_remove_group(kernel_kobj, &kernel_attr_group);
156kset_exit: 156kset_exit:
157 kobject_unregister(kernel_kobj); 157 kobject_put(kernel_kobj);
158exit: 158exit:
159 return error; 159 return error;
160} 160}
diff --git a/kernel/module.c b/kernel/module.c
index 89cd4c7361d8..dcb8a2cbf75e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1257,9 +1257,8 @@ int mod_sysfs_setup(struct module *mod,
1257out_unreg_param: 1257out_unreg_param:
1258 module_param_sysfs_remove(mod); 1258 module_param_sysfs_remove(mod);
1259out_unreg_holders: 1259out_unreg_holders:
1260 kobject_unregister(mod->holders_dir); 1260 kobject_put(mod->holders_dir);
1261out_unreg: 1261out_unreg:
1262 kobject_del(&mod->mkobj.kobj);
1263 kobject_put(&mod->mkobj.kobj); 1262 kobject_put(&mod->mkobj.kobj);
1264 return err; 1263 return err;
1265} 1264}
@@ -1269,9 +1268,9 @@ static void mod_kobject_remove(struct module *mod)
1269{ 1268{
1270 module_remove_modinfo_attrs(mod); 1269 module_remove_modinfo_attrs(mod);
1271 module_param_sysfs_remove(mod); 1270 module_param_sysfs_remove(mod);
1272 kobject_unregister(mod->mkobj.drivers_dir); 1271 kobject_put(mod->mkobj.drivers_dir);
1273 kobject_unregister(mod->holders_dir); 1272 kobject_put(mod->holders_dir);
1274 kobject_unregister(&mod->mkobj.kobj); 1273 kobject_put(&mod->mkobj.kobj);
1275} 1274}
1276 1275
1277/* 1276/*
diff --git a/lib/kobject.c b/lib/kobject.c
index 4fce5ca42c2e..462946ee3e64 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -664,7 +664,7 @@ struct kobject *kobject_create(void)
664 * 664 *
665 * This function creates a kset structure dynamically and registers it 665 * This function creates a kset structure dynamically and registers it
666 * with sysfs. When you are finished with this structure, call 666 * with sysfs. When you are finished with this structure, call
667 * kobject_unregister() and the structure will be dynamically freed when 667 * kobject_put() and the structure will be dynamically freed when
668 * it is no longer being used. 668 * it is no longer being used.
669 * 669 *
670 * If the kobject was not able to be created, NULL will be returned. 670 * If the kobject was not able to be created, NULL will be returned.
@@ -761,7 +761,7 @@ void kset_unregister(struct kset * k)
761{ 761{
762 if (!k) 762 if (!k)
763 return; 763 return;
764 kobject_unregister(&k->kobj); 764 kobject_put(&k->kobj);
765} 765}
766 766
767 767
diff --git a/net/bridge/br_sysfs_br.c b/net/bridge/br_sysfs_br.c
index 4e7f91fafedd..9cf0538d1717 100644
--- a/net/bridge/br_sysfs_br.c
+++ b/net/bridge/br_sysfs_br.c
@@ -447,7 +447,7 @@ void br_sysfs_delbr(struct net_device *dev)
447 struct kobject *kobj = &dev->dev.kobj; 447 struct kobject *kobj = &dev->dev.kobj;
448 struct net_bridge *br = netdev_priv(dev); 448 struct net_bridge *br = netdev_priv(dev);
449 449
450 kobject_unregister(br->ifobj); 450 kobject_put(br->ifobj);
451 sysfs_remove_bin_file(kobj, &bridge_forward); 451 sysfs_remove_bin_file(kobj, &bridge_forward);
452 sysfs_remove_group(kobj, &bridge_group); 452 sysfs_remove_group(kobj, &bridge_group);
453} 453}
diff --git a/security/inode.c b/security/inode.c
index def0cc1b07f2..acc6cf0d7900 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -327,7 +327,7 @@ static int __init securityfs_init(void)
327 327
328 retval = register_filesystem(&fs_type); 328 retval = register_filesystem(&fs_type);
329 if (retval) 329 if (retval)
330 kobject_unregister(security_kobj); 330 kobject_put(security_kobj);
331 return retval; 331 return retval;
332} 332}
333 333