Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3eb215de26e6e94bf5fed9cb77230c383b30e53b
Commit:     3eb215de26e6e94bf5fed9cb77230c383b30e53b
Parent:     85923b124624eb49ebef4731bb6b5670e792ff57
Author:     Dmitry Torokhov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 7 12:22:21 2007 -0400
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Sun Oct 7 16:42:22 2007 -0700

    Driver core: fix SYSF_DEPRECATED breakage for nested classdevs
    
    We should only reparent to a class former class devices that
    form the base of class hierarchy. Nested devices should still
    grow from their real parents.
    
    Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
    Tested-by: Andrey Borzenkov <[EMAIL PROTECTED]>
    Tested-by: Anssi Hannula <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 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 67c9258..ec86d6f 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;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to