diff options
| author | 2007-10-11 16:52:59 +1000 | |
|---|---|---|
| committer | 2007-10-11 16:52:59 +1000 | |
| commit | c1561cf463f4a480d1960e833c8fe628207b24e4 (patch) | |
| tree | b612e5257611ef33196aacc00fba813c943384d5 /drivers/base/core.c | |
| parent | Revert "[XFS] Avoid replaying inode buffer initialisation log items if on-disk version is newer." (diff) | |
| parent | Linux 2.6.23 (diff) | |
| download | linux-dev-c1561cf463f4a480d1960e833c8fe628207b24e4.tar.xz linux-dev-c1561cf463f4a480d1960e833c8fe628207b24e4.zip | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'drivers/base/core.c')
| -rw-r--r-- | drivers/base/core.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 67c92582d6ef..ec86d6fc2360 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -586,9 +586,13 @@ void device_initialize(struct device *dev) static struct kobject * get_device_parent(struct device *dev, struct device *parent) { - /* Set the parent to the class, not the parent device */ - /* this keeps sysfs from having a symlink to make old udevs happy */ - if (dev->class) + /* + * Set the parent to the class, not the parent device + * for topmost devices in class hierarchy. + * This keeps sysfs from having a symlink to make old + * udevs happy + */ + if (dev->class && (!parent || parent->class != dev->class)) return &dev->class->subsys.kobj; else if (parent) return &parent->kobj; |
