diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-05 19:52:44 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-05 19:52:44 +0200 |
commit | cd51d94890e819e6e72fd9dc221716131e69dea7 (patch) | |
tree | 0d848495754e896bfa0ec8eac200c47089c7fd1c /device.c | |
parent | 172bb90bce0354ed9a2d1e62bbe3daee45b32058 (diff) |
rename a variable for clarity
Diffstat (limited to 'device.c')
-rw-r--r-- | device.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -298,6 +298,20 @@ device_free_unused(struct device *dev) __device_free_unused(dev); } +void +device_init_pending(void) +{ + struct device *dev, *tmp; + + avl_for_each_element_safe(&devices, dev, avl, tmp) { + if (!dev->config_pending) + continue; + + dev->type->config_init(dev); + dev->config_pending = false; + } +} + enum dev_change_type device_reload_config(struct device *dev, struct blob_attr *attr) { @@ -379,9 +393,15 @@ device_create(const char *name, const struct device_type *type, } dev = type->create(config); + if (!dev) + return NULL; + dev->config = config; if (odev) device_replace(dev, odev); + if (!config_init && dev->config_pending) + type->config_init(dev); + return dev; } |