Skip to content

Commit

Permalink
bonding: initialize before registration
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stephen Hemminger authored and David S. Miller committed Jun 14, 2009
1 parent d2991f7 commit d932160
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5164,15 +5164,15 @@ int bond_create(const char *name)
goto out_netdev;
}

bond_set_lockdep_class(bond_dev);

netif_carrier_off(bond_dev);

res = register_netdevice(bond_dev);
if (res < 0) {
goto out_bond;
}

bond_set_lockdep_class(bond_dev);

netif_carrier_off(bond_dev);

up_write(&bonding_rwsem);
rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(netdev_priv(bond_dev));
Expand Down

0 comments on commit d932160

Please sign in to comment.