netifd: Set device down based on being a non external device in device_release
authorHans Dedecker <dedeckeh@gmail.com>
Wed, 30 Jul 2014 10:56:29 +0000 (10:56 +0000)
committerSteven Barth <steven@midlink.org>
Wed, 30 Jul 2014 13:21:55 +0000 (15:21 +0200)
Line up the device state manipulation by checking the external device parameter consistent and not the hotplug device parameter

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

index b16f15672f50b611197b27d8d3bf6eed392ddfd8..26b020f3f55674447299ed1c6b1a084c19ec2fa3 100644 (file)
--- a/device.c
+++ b/device.c
@@ -254,7 +254,7 @@ void device_release(struct device_user *dep)
                return;
 
        device_broadcast_event(dev, DEV_EVENT_TEARDOWN);
-       if (!dep->hotplug)
+       if (!dev->external)
                dev->set_state(dev, false);
        device_broadcast_event(dev, DEV_EVENT_DOWN);
 }