summaryrefslogtreecommitdiffhomepage
path: root/interface.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2011-10-21 02:41:44 +0200
committerFelix Fietkau <nbd@openwrt.org>2011-10-21 02:42:03 +0200
commita4e6adc43fe206eada9dfe5b99a6cc6ac451d702 (patch)
treec250f1390bc4fa8b8124c18f2d6ec18260a4befa /interface.c
parent43c2934a4d3f9a3e9d7fc2a4e9a32a2bef7174ba (diff)
fold __interface_set_up into interface_set_up
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/interface.c b/interface.c
index ca641ae..04834ec 100644
--- a/interface.c
+++ b/interface.c
@@ -104,30 +104,6 @@ mark_interface_down(struct interface *iface)
iface->state = IFS_DOWN;
}
-static int
-__interface_set_up(struct interface *iface)
-{
- int ret;
-
- if (iface->state != IFS_DOWN)
- return 0;
-
- if (iface->main_dev.dev) {
- ret = device_claim(&iface->main_dev);
- if (ret)
- return ret;
- }
-
- iface->state = IFS_SETUP;
- ret = interface_proto_event(iface->proto, PROTO_CMD_SETUP, false);
- if (ret) {
- mark_interface_down(iface);
- return ret;
- }
-
- return 0;
-}
-
void
__interface_set_down(struct interface *iface, bool force)
{
@@ -400,6 +376,8 @@ interface_add_link(struct interface *iface, struct device *dev)
int
interface_set_up(struct interface *iface)
{
+ int ret;
+
iface->autostart = true;
if (iface->state != IFS_DOWN)
@@ -411,7 +389,20 @@ interface_set_up(struct interface *iface)
return -1;
}
- return __interface_set_up(iface);
+ if (iface->main_dev.dev) {
+ ret = device_claim(&iface->main_dev);
+ if (ret)
+ return ret;
+ }
+
+ iface->state = IFS_SETUP;
+ ret = interface_proto_event(iface->proto, PROTO_CMD_SETUP, false);
+ if (ret) {
+ mark_interface_down(iface);
+ return ret;
+ }
+
+ return 0;
}
int