summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--device.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/device.c b/device.c
index 8f0e823..ab9138b 100644
--- 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);
}