netifd: Remove obsolete device_set_present in device_replace
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 4 Aug 2015 14:22:44 +0000 (16:22 +0200)
committerSteven Barth <steven@midlink.org>
Tue, 25 Aug 2015 06:23:38 +0000 (08:23 +0200)
New device does not need to be set present as device_check_state called via device_init
sets the device present after probing the kernel device

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
device.c

index 59a57f403803e11be4bda2268b11099ebee6ec1f..1636611b3f9dc47d98b024094ddc7089550b4904 100644 (file)
--- a/device.c
+++ b/device.c
@@ -702,10 +702,9 @@ static void
 device_replace(struct device *dev, struct device *odev)
 {
        struct device_user *dep, *tmp;
-       bool present = odev->present;
 
        __devlock++;
-       if (present)
+       if (odev->present)
                device_set_present(odev, false);
 
        list_for_each_entry_safe(dep, tmp, &odev->users.list, list.list) {
@@ -717,9 +716,6 @@ device_replace(struct device *dev, struct device *odev)
        __devlock--;
 
        device_free(odev);
-
-       if (present)
-               device_set_present(dev, true);
 }
 
 void