summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--device.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/device.c b/device.c
index f9ad25a..76feb68 100644
--- a/device.c
+++ b/device.c
@@ -337,8 +337,8 @@ device_replace(struct device *dev, struct device *odev)
device_set_present(odev, false);
list_for_each_entry_safe(dep, tmp, &odev->users, list) {
- list_move_tail(&dep->list, &dev->users);
- dep->dev = dev;
+ device_remove_user(dep);
+ device_add_user(dep, dev);
}
device_free(odev);