summaryrefslogtreecommitdiffhomepage
path: root/device.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-19 01:32:55 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-19 01:32:55 +0200
commitf8276b9b149f3b0c8f3cdf8d3d0c232bd92e3464 (patch)
treeeba0adb88f9e0408740c2855922db80ece63d55e /device.c
parentbeecba5195b2f1180f0bdfb6f61f0dbd3dff0eba (diff)
apply device settings to simple devices with config specified from the interface section (legacy format compatibility), but only if no other config was provided
Diffstat (limited to 'device.c')
-rw-r--r--device.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/device.c b/device.c
index ccba9d3..6eb730e 100644
--- a/device.c
+++ b/device.c
@@ -430,7 +430,7 @@ device_init_pending(void)
}
}
-enum dev_change_type
+static enum dev_change_type
device_reload_config(struct device *dev, struct blob_attr *attr)
{
struct blob_attr *tb[__DEV_ATTR_MAX];
@@ -442,7 +442,7 @@ device_reload_config(struct device *dev, struct blob_attr *attr)
if (cfg == &device_attr_list) {
memset(tb, 0, sizeof(tb));
- if (dev->config)
+ if (attr)
blobmsg_parse(dev_attrs, __DEV_ATTR_MAX, tb,
blob_data(attr), blob_len(attr));
@@ -452,9 +452,9 @@ device_reload_config(struct device *dev, struct blob_attr *attr)
return DEV_CONFIG_RECREATE;
}
-static enum dev_change_type
-device_check_config(struct device *dev, const struct device_type *type,
- struct blob_attr *attr)
+enum dev_change_type
+device_set_config(struct device *dev, const struct device_type *type,
+ struct blob_attr *attr)
{
if (type != dev->type)
return DEV_CONFIG_RECREATE;
@@ -525,7 +525,7 @@ device_create(const char *name, const struct device_type *type,
odev = device_get(name, false);
if (odev) {
odev->current_config = true;
- change = device_check_config(odev, type, config);
+ change = device_set_config(odev, type, config);
switch (change) {
case DEV_CONFIG_APPLIED:
D(DEVICE, "Device '%s': config applied\n", odev->ifname);