Commit d9321605 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

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: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d2991f75
...@@ -5164,15 +5164,15 @@ int bond_create(const char *name) ...@@ -5164,15 +5164,15 @@ int bond_create(const char *name)
goto out_netdev; goto out_netdev;
} }
bond_set_lockdep_class(bond_dev);
netif_carrier_off(bond_dev);
res = register_netdevice(bond_dev); res = register_netdevice(bond_dev);
if (res < 0) { if (res < 0) {
goto out_bond; goto out_bond;
} }
bond_set_lockdep_class(bond_dev);
netif_carrier_off(bond_dev);
up_write(&bonding_rwsem); up_write(&bonding_rwsem);
rtnl_unlock(); /* allows sysfs registration of net device */ rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(netdev_priv(bond_dev)); res = bond_create_sysfs_entry(netdev_priv(bond_dev));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment