]> err.no Git - linux-2.6/commitdiff
driver core: Use klist_remove() in device_move()
authorCornelia Huck <cornelia.huck@de.ibm.com>
Wed, 22 Nov 2006 16:49:39 +0000 (17:49 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 1 Dec 2006 22:52:02 +0000 (14:52 -0800)
As pointed out by Alan Stern, device_move needs to use klist_remove which waits
until removal is complete.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/core.c

index e4eaf46c4d9337cb1c0dbbd9c6d5cd8b9afa66fb..e4b530ef757de101329753e37cc1db524dce45c2 100644 (file)
@@ -1022,7 +1022,7 @@ int device_move(struct device *dev, struct device *new_parent)
        old_parent = dev->parent;
        dev->parent = new_parent;
        if (old_parent)
-               klist_del(&dev->knode_parent);
+               klist_remove(&dev->knode_parent);
        klist_add_tail(&dev->knode_parent, &new_parent->klist_children);
        if (!dev->class)
                goto out_put;
@@ -1031,7 +1031,7 @@ int device_move(struct device *dev, struct device *new_parent)
                /* We ignore errors on cleanup since we're hosed anyway... */
                device_move_class_links(dev, new_parent, old_parent);
                if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
-                       klist_del(&dev->knode_parent);
+                       klist_remove(&dev->knode_parent);
                        if (old_parent)
                                klist_add_tail(&dev->knode_parent,
                                               &old_parent->klist_children);