summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2009-04-20 04:49:28 +0000
committerDavid S. Miller <davem@davemloft.net>2009-04-21 02:00:51 -0700
commitb1b67dd45a6b629eb41553856805aaa1614fbb83 (patch)
tree23d2b8dc59223b649f466564dac338c899595a7c /drivers
parent4510d7cb8b4e7d389652b8a4f89fad469a5ecc92 (diff)
downloadblackbird-op-linux-b1b67dd45a6b629eb41553856805aaa1614fbb83.tar.gz
blackbird-op-linux-b1b67dd45a6b629eb41553856805aaa1614fbb83.zip
net: factor out ethtool invocation of vlan/macvlan drivers
Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/macvlan.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 214a8cf2b708..329cd50d0e29 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -374,36 +374,20 @@ static void macvlan_ethtool_get_drvinfo(struct net_device *dev,
static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev)
{
const struct macvlan_dev *vlan = netdev_priv(dev);
- struct net_device *lowerdev = vlan->lowerdev;
-
- if (lowerdev->ethtool_ops == NULL ||
- lowerdev->ethtool_ops->get_rx_csum == NULL)
- return 0;
- return lowerdev->ethtool_ops->get_rx_csum(lowerdev);
+ return dev_ethtool_get_rx_csum(vlan->lowerdev);
}
static int macvlan_ethtool_get_settings(struct net_device *dev,
struct ethtool_cmd *cmd)
{
const struct macvlan_dev *vlan = netdev_priv(dev);
- struct net_device *lowerdev = vlan->lowerdev;
-
- if (!lowerdev->ethtool_ops ||
- !lowerdev->ethtool_ops->get_settings)
- return -EOPNOTSUPP;
-
- return lowerdev->ethtool_ops->get_settings(lowerdev, cmd);
+ return dev_ethtool_get_settings(vlan->lowerdev, cmd);
}
static u32 macvlan_ethtool_get_flags(struct net_device *dev)
{
const struct macvlan_dev *vlan = netdev_priv(dev);
- struct net_device *lowerdev = vlan->lowerdev;
-
- if (!lowerdev->ethtool_ops ||
- !lowerdev->ethtool_ops->get_flags)
- return 0;
- return lowerdev->ethtool_ops->get_flags(lowerdev);
+ return dev_ethtool_get_flags(vlan->lowerdev);
}
static const struct ethtool_ops macvlan_ethtool_ops = {
OpenPOWER on IntegriCloud