kobject: Cleanup kobject_rename and !CONFIG_SYSFS

It finally dawned on me what the clean fix to sysfs_rename_dir
calling kobject_set_name is.  Move the work into kobject_rename
where it belongs.  The callers serialize us anyway so this is
safe.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Eric W. Biederman
2008-07-03 18:05:28 -07:00
committed by Greg Kroah-Hartman
parent 030c1d2bfc
commit 0b4a4fea25
3 changed files with 17 additions and 10 deletions

View File

@ -20,8 +20,6 @@
struct kobject;
struct module;
extern int kobject_set_name(struct kobject *kobj, const char *name, ...)
__attribute__((format(printf, 2, 3)));
/* FIXME
* The *owner field is no longer used, but leave around
* until the tree gets cleaned up fully.
@ -149,7 +147,7 @@ static inline void sysfs_remove_dir(struct kobject *kobj)
static inline int sysfs_rename_dir(struct kobject *kobj, const char *new_name)
{
return kobject_set_name(kobj, "%s", new_name);
return 0;
}
static inline int sysfs_move_dir(struct kobject *kobj,