From cd51d94890e819e6e72fd9dc221716131e69dea7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Oct 2011 19:52:44 +0200 Subject: rename a variable for clarity --- device.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'device.c') diff --git a/device.c b/device.c index 91a7867..c6765b0 100644 --- a/device.c +++ b/device.c @@ -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; } -- cgit v1.2.3