Kobject: convert drivers/* from 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>
This commit is contained in:
Greg Kroah-Hartman
2007-12-20 08:13:05 -08:00
parent 38a382ae5d
commit c10997f657
17 changed files with 40 additions and 42 deletions

View File

@ -303,7 +303,7 @@ void edac_device_unregister_sysfs_main_kobj(
* a) module_put() this module
* b) 'kfree' the memory
*/
kobject_unregister(&edac_dev->kobj);
kobject_put(&edac_dev->kobj);
}
/* edac_dev -> instance information */
@ -574,7 +574,7 @@ static int edac_device_create_block(struct edac_device_ctl_info *edac_dev,
/* Error unwind stack */
err_on_attrib:
kobject_unregister(&block->kobj);
kobject_put(&block->kobj);
err_out:
return err;
@ -605,7 +605,7 @@ static void edac_device_delete_block(struct edac_device_ctl_info *edac_dev,
/* unregister this block's kobject, SEE:
* edac_device_ctrl_block_release() callback operation
*/
kobject_unregister(&block->kobj);
kobject_put(&block->kobj);
}
/* instance ctor/dtor code */
@ -672,7 +672,7 @@ static int edac_device_create_instance(struct edac_device_ctl_info *edac_dev,
/* error unwind stack */
err_release_instance_kobj:
kobject_unregister(&instance->kobj);
kobject_put(&instance->kobj);
err_out:
return err;
@ -697,7 +697,7 @@ static void edac_device_delete_instance(struct edac_device_ctl_info *edac_dev,
/* unregister this instance's kobject, SEE:
* edac_device_ctrl_instance_release() for callback operation
*/
kobject_unregister(&instance->kobj);
kobject_put(&instance->kobj);
}
/*

View File

@ -395,7 +395,7 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
goto err_release_top_kobj;
/* At this point, to release a csrow kobj, one must
* call the kobject_unregister and allow that tear down
* call the kobject_put and allow that tear down
* to work the releasing
*/
@ -406,7 +406,7 @@ static int edac_create_csrow_object(struct mem_ctl_info *mci,
err = edac_create_channel_files(&csrow->kobj, chan);
if (err) {
/* special case the unregister here */
kobject_unregister(&csrow->kobj);
kobject_put(&csrow->kobj);
goto err_out;
}
}
@ -808,7 +808,7 @@ fail_out:
void edac_mc_unregister_sysfs_main_kobj(struct mem_ctl_info *mci)
{
/* delete the kobj from the mc_kset */
kobject_unregister(&mci->edac_mci_kobj);
kobject_put(&mci->edac_mci_kobj);
}
#define EDAC_DEVICE_SYMLINK "device"
@ -923,7 +923,7 @@ int edac_create_sysfs_mci_device(struct mem_ctl_info *mci)
fail1:
for (i--; i >= 0; i--) {
if (csrow->nr_pages > 0) {
kobject_unregister(&mci->csrows[i].kobj);
kobject_put(&mci->csrows[i].kobj);
}
}
@ -950,7 +950,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
for (i = 0; i < mci->nr_csrows; i++) {
if (mci->csrows[i].nr_pages > 0) {
debugf0("%s() unreg csrow-%d\n", __func__, i);
kobject_unregister(&mci->csrows[i].kobj);
kobject_put(&mci->csrows[i].kobj);
}
}
@ -967,7 +967,7 @@ void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci)
debugf0("%s() unregister this mci kobj\n", __func__);
/* unregister this instance's kobject */
kobject_unregister(&mci->edac_mci_kobj);
kobject_put(&mci->edac_mci_kobj);
}

View File

@ -205,7 +205,7 @@ void edac_pci_unregister_sysfs_instance_kobj(struct edac_pci_ctl_info *pci)
* function release the main reference count and then
* kfree the memory
*/
kobject_unregister(&pci->kobj);
kobject_put(&pci->kobj);
}
/***************************** EDAC PCI sysfs root **********************/
@ -411,9 +411,9 @@ static void edac_pci_main_kobj_teardown(void)
* main kobj
*/
if (atomic_dec_return(&edac_pci_sysfs_refcount) == 0) {
debugf0("%s() called kobject_unregister on main kobj\n",
debugf0("%s() called kobject_put on main kobj\n",
__func__);
kobject_unregister(&edac_pci_top_main_kobj);
kobject_put(&edac_pci_top_main_kobj);
}
}