mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Acked-by: Tejun Heo <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
030c1d2bfc
commit
0b4a4fea25
3 changed files with 17 additions and 10 deletions
|
|
@ -829,16 +829,12 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
|
|||
if (!new_dentry)
|
||||
goto out_unlock;
|
||||
|
||||
/* rename kobject and sysfs_dirent */
|
||||
/* rename sysfs_dirent */
|
||||
error = -ENOMEM;
|
||||
new_name = dup_name = kstrdup(new_name, GFP_KERNEL);
|
||||
if (!new_name)
|
||||
goto out_unlock;
|
||||
|
||||
error = kobject_set_name(kobj, "%s", new_name);
|
||||
if (error)
|
||||
goto out_unlock;
|
||||
|
||||
dup_name = sd->s_name;
|
||||
sd->s_name = new_name;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue