diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2009-06-12 15:02:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-14 02:28:52 -0400 |
commit | d93216051ae60995736518ca9ebb58a0e6ade212 (patch) | |
tree | 0f2e6c6d4abef68b54fb58a6397376871a277f91 /drivers/net | |
parent | d2991f75354941a4cdf61ce7443d21804b978f89 (diff) |
bonding: initialize before registration
Avoid a unnecessary carrier state transistion that happens when device
is registered.
Lockdep works better if initialization is done before registration as well.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a1fa8deb254e..99ddd283e15e 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -5164,15 +5164,15 @@ int bond_create(const char *name) | |||
5164 | goto out_netdev; | 5164 | goto out_netdev; |
5165 | } | 5165 | } |
5166 | 5166 | ||
5167 | bond_set_lockdep_class(bond_dev); | ||
5168 | |||
5169 | netif_carrier_off(bond_dev); | ||
5170 | |||
5167 | res = register_netdevice(bond_dev); | 5171 | res = register_netdevice(bond_dev); |
5168 | if (res < 0) { | 5172 | if (res < 0) { |
5169 | goto out_bond; | 5173 | goto out_bond; |
5170 | } | 5174 | } |
5171 | 5175 | ||
5172 | bond_set_lockdep_class(bond_dev); | ||
5173 | |||
5174 | netif_carrier_off(bond_dev); | ||
5175 | |||
5176 | up_write(&bonding_rwsem); | 5176 | up_write(&bonding_rwsem); |
5177 | rtnl_unlock(); /* allows sysfs registration of net device */ | 5177 | rtnl_unlock(); /* allows sysfs registration of net device */ |
5178 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); | 5178 | res = bond_create_sysfs_entry(netdev_priv(bond_dev)); |