X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fnet%2Fbonding%2Fbond_main.c;h=ef2cb2418535bb3cadc9f227aff1b5884b793996;hb=4351654e3ddf86a04966163dce4def586303e5cc;hp=a7d47350ea4b5657d4ee9683b92d7243ea2a9361;hpb=c6bd5bcc4983f1a2d2f87a3769bf309482ee8c04;p=karo-tx-linux.git diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a7d47350ea4b..ef2cb2418535 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -615,15 +615,9 @@ static int bond_check_dev_link(struct bonding *bond, return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; /* Try to get link status using Ethtool first. */ - if (slave_dev->ethtool_ops) { - if (slave_dev->ethtool_ops->get_link) { - u32 link; - - link = slave_dev->ethtool_ops->get_link(slave_dev); - - return link ? BMSR_LSTATUS : 0; - } - } + if (slave_dev->ethtool_ops->get_link) + return slave_dev->ethtool_ops->get_link(slave_dev) ? + BMSR_LSTATUS : 0; /* Ethtool can't be used, fallback to MII ioctls. */ ioctl = slave_ops->ndo_do_ioctl; @@ -1510,8 +1504,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) int link_reporting; int res = 0; - if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && - slave_ops->ndo_do_ioctl == NULL) { + if (!bond->params.use_carrier && + slave_dev->ethtool_ops->get_link == NULL && + slave_ops->ndo_do_ioctl == NULL) { pr_warning("%s: Warning: no link monitoring support for %s\n", bond_dev->name, slave_dev->name); } @@ -1838,7 +1833,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) * anyway (it holds no special properties of the bond device), * so we can change it without calling change_active_interface() */ - if (!bond->curr_active_slave) + if (!bond->curr_active_slave && new_slave->link == BOND_LINK_UP) bond->curr_active_slave = new_slave; break;