diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-07-18 14:58:15 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-07-18 17:40:54 +0200 |
commit | c057e711b2830a393206bf3d43a69ede0f5e0945 (patch) | |
tree | 14db8916ec2a56693ac2e87d75f95acb47141db8 /device.c | |
parent | 330f4032e32741f7f604d742616e4aad86452f4d (diff) |
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 <nbd@nbd.name>
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } |