Commit c772dde3 authored by Ben Hutchings's avatar Ben Hutchings Committed by David S. Miller

bonding: Fix check for ethtool get_link operation support

Since commit 2c60db03 ('net: provide a default dev->ethtool_ops')
all devices have a non-null ethtool_ops.  Test only
dev->ethtool_ops->get_link in both places where we care.
Signed-off-by: default avatarBen Hutchings <bhutchings@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee07c6e7
...@@ -615,15 +615,9 @@ static int bond_check_dev_link(struct bonding *bond, ...@@ -615,15 +615,9 @@ static int bond_check_dev_link(struct bonding *bond,
return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0; return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
/* Try to get link status using Ethtool first. */ /* Try to get link status using Ethtool first. */
if (slave_dev->ethtool_ops) { if (slave_dev->ethtool_ops->get_link)
if (slave_dev->ethtool_ops->get_link) { return slave_dev->ethtool_ops->get_link(slave_dev) ?
u32 link; BMSR_LSTATUS : 0;
link = slave_dev->ethtool_ops->get_link(slave_dev);
return link ? BMSR_LSTATUS : 0;
}
}
/* Ethtool can't be used, fallback to MII ioctls. */ /* Ethtool can't be used, fallback to MII ioctls. */
ioctl = slave_ops->ndo_do_ioctl; ioctl = slave_ops->ndo_do_ioctl;
...@@ -1510,7 +1504,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) ...@@ -1510,7 +1504,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
int link_reporting; int link_reporting;
int res = 0; int res = 0;
if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL && if (!bond->params.use_carrier &&
slave_dev->ethtool_ops->get_link == NULL &&
slave_ops->ndo_do_ioctl == NULL) { slave_ops->ndo_do_ioctl == NULL) {
pr_warning("%s: Warning: no link monitoring support for %s\n", pr_warning("%s: Warning: no link monitoring support for %s\n",
bond_dev->name, slave_dev->name); bond_dev->name, slave_dev->name);
......
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