Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65037
b: refs/heads/master
c: 4f01a75
h: refs/heads/master
i:
  65035: 4f6fd67
v: v3
  • Loading branch information
Dmitry Torokhov authored and Linus Torvalds committed Sep 19, 2007
1 parent ae355c8 commit ebc540f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 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: 508a92741a105e2e3d466cd727fb73154ebf08de
refs/heads/master: 4f01a757e75f2a3cab2bab89c4176498963946b9
29 changes: 23 additions & 6 deletions trunk/drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,21 +679,38 @@ static int device_add_class_symlinks(struct device *dev)
goto out_subsys;
}
if (dev->parent) {
error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,
"device");
if (error)
goto out_busid;
#ifdef CONFIG_SYSFS_DEPRECATED
{
char * class_name = make_class_name(dev->class->name,
&dev->kobj);
struct device *parent = dev->parent;
char *class_name;

/*
* In old sysfs stacked class devices had 'device'
* link pointing to real device instead of parent
*/
while (parent->class && !parent->bus && parent->parent)
parent = parent->parent;

error = sysfs_create_link(&dev->kobj,
&parent->kobj,
"device");
if (error)
goto out_busid;

class_name = make_class_name(dev->class->name,
&dev->kobj);
if (class_name)
error = sysfs_create_link(&dev->parent->kobj,
&dev->kobj, class_name);
kfree(class_name);
if (error)
goto out_device;
}
#else
error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,
"device");
if (error)
goto out_busid;
#endif
}
return 0;
Expand Down

0 comments on commit ebc540f

Please sign in to comment.