diff --git a/[refs] b/[refs] index 7578db45b56a..85e10ed8a4ed 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 85923b124624eb49ebef4731bb6b5670e792ff57 +refs/heads/master: 3eb215de26e6e94bf5fed9cb77230c383b30e53b diff --git a/trunk/drivers/base/core.c b/trunk/drivers/base/core.c index 67c92582d6ef..ec86d6fc2360 100644 --- a/trunk/drivers/base/core.c +++ b/trunk/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;