diff options
| -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) | |||
| 586 | static struct kobject * get_device_parent(struct device *dev, | 586 | static struct kobject * get_device_parent(struct device *dev, |
| 587 | struct device *parent) | 587 | struct device *parent) |
| 588 | { | 588 | { |
| 589 | /* Set the parent to the class, not the parent device */ | 589 | /* |
| 590 | /* this keeps sysfs from having a symlink to make old udevs happy */ | 590 | * Set the parent to the class, not the parent device |
| 591 | if (dev->class) | 591 | * for topmost devices in class hierarchy. |
| 592 | * This keeps sysfs from having a symlink to make old | ||
| 593 | * udevs happy | ||
| 594 | */ | ||
| 595 | if (dev->class && (!parent || parent->class != dev->class)) | ||
| 592 | return &dev->class->subsys.kobj; | 596 | return &dev->class->subsys.kobj; |
| 593 | else if (parent) | 597 | else if (parent) |
| 594 | return &parent->kobj; | 598 | return &parent->kobj; |
