mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
sysfs: Allow sysfs_move_dir(..., NULL) again.
As device_move() and kobject_move() both handle a NULL destination, sysfs_move_dir() should do this as well (again) and fall back to sysfs_root in that case. Signed-off-by: Cornelia Huck <[email protected]> Cc: Phil Carmody <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
80f506918f
commit
a6a8357788
1 changed files with 2 additions and 1 deletions
|
|
@ -894,7 +894,8 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
|
|||
|
||||
mutex_lock(&sysfs_rename_mutex);
|
||||
BUG_ON(!sd->s_parent);
|
||||
new_parent_sd = new_parent_kobj->sd ? new_parent_kobj->sd : &sysfs_root;
|
||||
new_parent_sd = (new_parent_kobj && new_parent_kobj->sd) ?
|
||||
new_parent_kobj->sd : &sysfs_root;
|
||||
|
||||
error = 0;
|
||||
if (sd->s_parent == new_parent_sd)
|
||||
|
|
|
|||
Loading…
Reference in a new issue