do not bring down hotplug devices
authorFelix Fietkau <nbd@openwrt.org>
Sat, 3 Mar 2012 19:55:39 +0000 (20:55 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 3 Mar 2012 19:55:39 +0000 (20:55 +0100)
device.c

index 8f0e823373e75e27eeb53f656a122f393fa0d34a..ab9138b3be84f3db9adf19e81f5530c7abf790b2 100644 (file)
--- a/device.c
+++ b/device.c
@@ -312,7 +312,8 @@ void device_release(struct device_user *dep)
                return;
 
        device_broadcast_event(dev, DEV_EVENT_TEARDOWN);
-       dev->set_state(dev, false);
+       if (!dep->hotplug)
+               dev->set_state(dev, false);
        device_broadcast_event(dev, DEV_EVENT_DOWN);
 }