diff options
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 872658927e47..f1647d7dd14b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -120,6 +120,8 @@ | |||
120 | #include <linux/ctype.h> | 120 | #include <linux/ctype.h> |
121 | #include <linux/if_arp.h> | 121 | #include <linux/if_arp.h> |
122 | 122 | ||
123 | #include "net-sysfs.h" | ||
124 | |||
123 | /* | 125 | /* |
124 | * The list of packet types we will receive (as opposed to discard) | 126 | * The list of packet types we will receive (as opposed to discard) |
125 | * and the routines to invoke. | 127 | * and the routines to invoke. |
@@ -249,10 +251,6 @@ static RAW_NOTIFIER_HEAD(netdev_chain); | |||
249 | 251 | ||
250 | DEFINE_PER_CPU(struct softnet_data, softnet_data); | 252 | DEFINE_PER_CPU(struct softnet_data, softnet_data); |
251 | 253 | ||
252 | extern int netdev_kobject_init(void); | ||
253 | extern int netdev_register_kobject(struct net_device *); | ||
254 | extern void netdev_unregister_kobject(struct net_device *); | ||
255 | |||
256 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 254 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
257 | /* | 255 | /* |
258 | * register_netdevice() inits dev->_xmit_lock and sets lockdep class | 256 | * register_netdevice() inits dev->_xmit_lock and sets lockdep class |
@@ -1007,17 +1005,20 @@ int dev_open(struct net_device *dev) | |||
1007 | * Call device private open method | 1005 | * Call device private open method |
1008 | */ | 1006 | */ |
1009 | set_bit(__LINK_STATE_START, &dev->state); | 1007 | set_bit(__LINK_STATE_START, &dev->state); |
1010 | if (dev->open) { | 1008 | |
1009 | if (dev->validate_addr) | ||
1010 | ret = dev->validate_addr(dev); | ||
1011 | |||
1012 | if (!ret && dev->open) | ||
1011 | ret = dev->open(dev); | 1013 | ret = dev->open(dev); |
1012 | if (ret) | ||
1013 | clear_bit(__LINK_STATE_START, &dev->state); | ||
1014 | } | ||
1015 | 1014 | ||
1016 | /* | 1015 | /* |
1017 | * If it went open OK then: | 1016 | * If it went open OK then: |
1018 | */ | 1017 | */ |
1019 | 1018 | ||
1020 | if (!ret) { | 1019 | if (ret) |
1020 | clear_bit(__LINK_STATE_START, &dev->state); | ||
1021 | else { | ||
1021 | /* | 1022 | /* |
1022 | * Set the flags. | 1023 | * Set the flags. |
1023 | */ | 1024 | */ |
@@ -1038,6 +1039,7 @@ int dev_open(struct net_device *dev) | |||
1038 | */ | 1039 | */ |
1039 | call_netdevice_notifiers(NETDEV_UP, dev); | 1040 | call_netdevice_notifiers(NETDEV_UP, dev); |
1040 | } | 1041 | } |
1042 | |||
1041 | return ret; | 1043 | return ret; |
1042 | } | 1044 | } |
1043 | 1045 | ||