aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorManeesh Soni <maneesh@in.ibm.com>2004-05-13 22:13:00 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2004-05-13 22:13:00 -0700
commit51c0c34c8f0ac464c97aaef4754e7dc163dd586e (patch)
tree2a1e0d29b4867dd8d48f96517d0d66a667184b8a /lib
parentf00beb55bde63c01a8ee200e33c7f3d72a4e92b7 (diff)
downloadhistory-51c0c34c8f0ac464c97aaef4754e7dc163dd586e.tar.gz
[PATCH] sysfs_rename_dir-cleanup
o The following patch cleans up sysfs_rename_dir(). It now checks the return code of kobject_set_name() and propagates the error code to its callers. Because of this there are changes in the following two APIs. Both return int instead of void. int sysfs_rename_dir(struct kobject * kobj, const char *new_name) int kobject_rename(struct kobject * kobj, char *new_name)
Diffstat (limited to 'lib')
-rw-r--r--lib/kobject.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 5e8d1ed7071658..5c2ade5739beb6 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -385,13 +385,17 @@ EXPORT_SYMBOL(kobject_set_name);
* @new_name: object's new name
*/
-void kobject_rename(struct kobject * kobj, char *new_name)
+int kobject_rename(struct kobject * kobj, char *new_name)
{
+ int error = 0;
+
kobj = kobject_get(kobj);
if (!kobj)
- return;
- sysfs_rename_dir(kobj, new_name);
+ return -EINVAL;
+ error = sysfs_rename_dir(kobj, new_name);
kobject_put(kobj);
+
+ return error;
}
/**