From 5fefb43a4151ee99d4c78ebaf1807043e859021a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 23 Jan 2012 14:09:43 +0100 Subject: always call device_set_disabled, even if the "enabled" attribute is not present --- device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/device.c b/device.c index 84e6528..d47bcdf 100644 --- a/device.c +++ b/device.c @@ -197,12 +197,11 @@ device_init_settings(struct device *dev, struct blob_attr **tb) struct device_settings *s = &dev->settings; struct blob_attr *cur; struct ether_addr *ea; + bool disabled = false; s->flags = 0; - dev->disabled = false; - if ((cur = tb[DEV_ATTR_ENABLED])) - device_set_disabled(dev, !blobmsg_get_bool(cur)); + disabled = !blobmsg_get_bool(cur); if ((cur = tb[DEV_ATTR_MTU])) { s->mtu = blobmsg_get_u32(cur); @@ -221,6 +220,8 @@ device_init_settings(struct device *dev, struct blob_attr **tb) s->flags |= DEV_OPT_MACADDR; } } + + device_set_disabled(dev, disabled); } static void __init dev_init(void) -- cgit v1.2.3