summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2021-06-19 08:11:21 +0200
committerFelix Fietkau <nbd@nbd.name>2021-06-19 08:11:23 +0200
commitff3764ce28e0672d8290e925d13a34ddbf38c984 (patch)
treebed6a1077beba41c0b31c24f11e0fcb95bacf96b /device.c
parentb0d0906883021baca9ef6e80ba0480ac3e2a4b7a (diff)
downloadnetifd-ff3764ce28e0672d8290e925d13a34ddbf38c984.tar.gz
device: move hotplug handling logic from system-linux.c to device.c
Preparation for dealing with wifi per-station devices Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'device.c')
-rw-r--r--device.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/device.c b/device.c
index 9bad507..d8617fc 100644
--- a/device.c
+++ b/device.c
@@ -1208,3 +1208,14 @@ static void __init simple_device_type_init(void)
{
device_type_add(&simple_device_type);
}
+
+void device_hotplug_event(const char *name, bool add)
+{
+ struct device *dev;
+
+ dev = device_find(name);
+ if (!dev || dev->type != &simple_device_type)
+ return;
+
+ device_set_present(dev, add);
+}