aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 59d9816c332e..b78fc1e68264 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -565,7 +565,7 @@ static struct kobject * get_device_parent(struct device *dev,
565 /* Set the parent to the class, not the parent device */ 565 /* Set the parent to the class, not the parent device */
566 /* this keeps sysfs from having a symlink to make old udevs happy */ 566 /* this keeps sysfs from having a symlink to make old udevs happy */
567 if (dev->class) 567 if (dev->class)
568 return &dev->class->subsys.kset.kobj; 568 return &dev->class->subsys.kobj;
569 else if (parent) 569 else if (parent)
570 return &parent->kobj; 570 return &parent->kobj;
571 571
@@ -577,7 +577,7 @@ static struct kobject *virtual_device_parent(struct device *dev)
577 static struct kobject *virtual_dir = NULL; 577 static struct kobject *virtual_dir = NULL;
578 578
579 if (!virtual_dir) 579 if (!virtual_dir)
580 virtual_dir = kobject_add_dir(&devices_subsys.kset.kobj, "virtual"); 580 virtual_dir = kobject_add_dir(&devices_subsys.kobj, "virtual");
581 581
582 return virtual_dir; 582 return virtual_dir;
583} 583}
@@ -711,12 +711,12 @@ int device_add(struct device *dev)
711 } 711 }
712 712
713 if (dev->class) { 713 if (dev->class) {
714 sysfs_create_link(&dev->kobj, &dev->class->subsys.kset.kobj, 714 sysfs_create_link(&dev->kobj, &dev->class->subsys.kobj,
715 "subsystem"); 715 "subsystem");
716 /* If this is not a "fake" compatible device, then create the 716 /* If this is not a "fake" compatible device, then create the
717 * symlink from the class to the device. */ 717 * symlink from the class to the device. */
718 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 718 if (dev->kobj.parent != &dev->class->subsys.kobj)
719 sysfs_create_link(&dev->class->subsys.kset.kobj, 719 sysfs_create_link(&dev->class->subsys.kobj,
720 &dev->kobj, dev->bus_id); 720 &dev->kobj, dev->bus_id);
721 if (parent) { 721 if (parent) {
722 sysfs_create_link(&dev->kobj, &dev->parent->kobj, 722 sysfs_create_link(&dev->kobj, &dev->parent->kobj,
@@ -774,8 +774,8 @@ int device_add(struct device *dev)
774 sysfs_remove_link(&dev->kobj, "subsystem"); 774 sysfs_remove_link(&dev->kobj, "subsystem");
775 /* If this is not a "fake" compatible device, remove the 775 /* If this is not a "fake" compatible device, remove the
776 * symlink from the class to the device. */ 776 * symlink from the class to the device. */
777 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 777 if (dev->kobj.parent != &dev->class->subsys.kobj)
778 sysfs_remove_link(&dev->class->subsys.kset.kobj, 778 sysfs_remove_link(&dev->class->subsys.kobj,
779 dev->bus_id); 779 dev->bus_id);
780 if (parent) { 780 if (parent) {
781#ifdef CONFIG_SYSFS_DEPRECATED 781#ifdef CONFIG_SYSFS_DEPRECATED
@@ -875,8 +875,8 @@ void device_del(struct device * dev)
875 sysfs_remove_link(&dev->kobj, "subsystem"); 875 sysfs_remove_link(&dev->kobj, "subsystem");
876 /* If this is not a "fake" compatible device, remove the 876 /* If this is not a "fake" compatible device, remove the
877 * symlink from the class to the device. */ 877 * symlink from the class to the device. */
878 if (dev->kobj.parent != &dev->class->subsys.kset.kobj) 878 if (dev->kobj.parent != &dev->class->subsys.kobj)
879 sysfs_remove_link(&dev->class->subsys.kset.kobj, 879 sysfs_remove_link(&dev->class->subsys.kobj,
880 dev->bus_id); 880 dev->bus_id);
881 if (parent) { 881 if (parent) {
882#ifdef CONFIG_SYSFS_DEPRECATED 882#ifdef CONFIG_SYSFS_DEPRECATED
@@ -1192,9 +1192,9 @@ int device_rename(struct device *dev, char *new_name)
1192#endif 1192#endif
1193 1193
1194 if (dev->class) { 1194 if (dev->class) {
1195 sysfs_remove_link(&dev->class->subsys.kset.kobj, 1195 sysfs_remove_link(&dev->class->subsys.kobj,
1196 old_symlink_name); 1196 old_symlink_name);
1197 sysfs_create_link(&dev->class->subsys.kset.kobj, &dev->kobj, 1197 sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
1198 dev->bus_id); 1198 dev->bus_id);
1199 } 1199 }
1200 put_device(dev); 1200 put_device(dev);