Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196056
b: refs/heads/master
c: f349cf3
h: refs/heads/master
v: v3
  • Loading branch information
Eric W. Biederman authored and Greg Kroah-Hartman committed May 21, 2010
1 parent da3a50b commit d54a83a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 746edb7ae8a1abdd39be2b28c03aa073183340db
refs/heads/master: f349cf34731c3b3eddbcd63cb04489aee2c405bd
21 changes: 12 additions & 9 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ static int device_add_class_symlinks(struct device *dev)
out_busid:
if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
device_is_not_partition(dev))
sysfs_remove_link(&dev->class->p->class_subsys.kobj,
sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj,
dev_name(dev));
#else
/* link in the class directory pointing to the device */
Expand All @@ -804,7 +804,7 @@ static int device_add_class_symlinks(struct device *dev)
return 0;

out_busid:
sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
#endif

out_subsys:
Expand Down Expand Up @@ -832,13 +832,13 @@ static void device_remove_class_symlinks(struct device *dev)

if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
device_is_not_partition(dev))
sysfs_remove_link(&dev->class->p->class_subsys.kobj,
sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj,
dev_name(dev));
#else
if (dev->parent && device_is_not_partition(dev))
sysfs_remove_link(&dev->kobj, "device");

sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
#endif

sysfs_remove_link(&dev->kobj, "subsystem");
Expand Down Expand Up @@ -1624,6 +1624,14 @@ int device_rename(struct device *dev, char *new_name)
goto out;
}

#ifndef CONFIG_SYSFS_DEPRECATED
if (dev->class) {
error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
&dev->kobj, old_device_name, new_name);
if (error)
goto out;
}
#endif
error = kobject_rename(&dev->kobj, new_name);
if (error)
goto out;
Expand All @@ -1638,11 +1646,6 @@ int device_rename(struct device *dev, char *new_name)
new_class_name);
}
}
#else
if (dev->class) {
error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
&dev->kobj, old_device_name, new_name);
}
#endif

out:
Expand Down

0 comments on commit d54a83a

Please sign in to comment.