fold __interface_set_up into interface_set_up
authorFelix Fietkau <nbd@openwrt.org>
Fri, 21 Oct 2011 00:41:44 +0000 (02:41 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Fri, 21 Oct 2011 00:42:03 +0000 (02:42 +0200)
interface.c

index ca641aeb1bec9c5602211d25780a739bd55ae209..04834ec022c78d71f4a15c846029cfdc588dd35d 100644 (file)
@@ -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