summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2012-03-03 20:55:03 +0100
committerFelix Fietkau <nbd@openwrt.org>2012-03-03 20:55:03 +0100
commitf5f78c1eca1fe2df04dae56a4d9f024533066b29 (patch)
treed224a80554f4ee56a9a4db6547ba808de2d0e494 /device.c
parentaff73720b65ca33a487c813f27644f8d5aea0df1 (diff)
preserve interface main hotplug device on reload
Diffstat (limited to 'device.c')
-rw-r--r--device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/device.c b/device.c
index 489c660..8f0e823 100644
--- a/device.c
+++ b/device.c
@@ -465,6 +465,9 @@ device_set_disabled(struct device *dev, bool value)
void device_add_user(struct device_user *dep, struct device *dev)
{
+ if (dep->dev)
+ device_remove_user(dep);
+
dep->dev = dev;
list_add_tail(&dep->list, &dev->users);
if (dep->cb && dev->present) {