From ff3764ce28e0672d8290e925d13a34ddbf38c984 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 19 Jun 2021 08:11:21 +0200 Subject: 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 --- device.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'device.c') 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); +} -- cgit v1.2.1