From c057e711b2830a393206bf3d43a69ede0f5e0945 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 18 Jul 2020 14:58:15 +0200 Subject: device: do not check state from within device_init At this point the device is usually not fully set up yet and cannot handle state changes / bringup Signed-off-by: Felix Fietkau --- device.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'device.c') diff --git a/device.c b/device.c index 128151a..70cb6a7 100644 --- a/device.c +++ b/device.c @@ -509,7 +509,6 @@ int device_init(struct device *dev, struct device_type *type, const char *ifname return ret; system_if_clear_state(dev); - device_check_state(dev); return 0; } @@ -539,6 +538,9 @@ device_create_default(const char *name, bool external) dev->default_config = true; if (external) system_if_apply_settings(dev, &dev->settings, dev->settings.flags); + + device_check_state(dev); + return dev; } @@ -794,6 +796,7 @@ device_init_pending(void) dev->type->config_init(dev); dev->config_pending = false; + device_check_state(dev); } } @@ -956,6 +959,8 @@ device_create(const char *name, struct device_type *type, dev->config_pending = false; } + device_check_state(dev); + return dev; } -- cgit v1.2.3