ethtool: Provide a default implementation of ethtool_ops::get_drvinfo
The driver name and bus address for a net_device can normally be found through the driver model now. Instead of requiring drivers to provide this information redundantly through the ethtool_ops::get_drvinfo operation, use the driver model to do so if the driver does not define the operation. Since ETHTOOL_GDRVINFO no longer requires the driver to implement any operations, do not require net_device::ethtool_ops to be set either. Remove implementations of get_drvinfo and ethtool_ops that provide only this information. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
bb8a10bbd1
commit
0141480205
@ -843,16 +843,7 @@ static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb,
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
|
||||
{
|
||||
struct hso_net *odev = netdev_priv(net);
|
||||
|
||||
strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN);
|
||||
usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
|
||||
}
|
||||
|
||||
static const struct ethtool_ops ops = {
|
||||
.get_drvinfo = hso_get_drvinfo,
|
||||
.get_link = ethtool_op_get_link
|
||||
};
|
||||
|
||||
|
@ -759,14 +759,6 @@ static int kaweth_close(struct net_device *net)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void kaweth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||
{
|
||||
struct kaweth_device *kaweth = netdev_priv(dev);
|
||||
|
||||
strlcpy(info->driver, driver_name, sizeof(info->driver));
|
||||
usb_make_path(kaweth->dev, info->bus_info, sizeof (info->bus_info));
|
||||
}
|
||||
|
||||
static u32 kaweth_get_link(struct net_device *dev)
|
||||
{
|
||||
struct kaweth_device *kaweth = netdev_priv(dev);
|
||||
@ -775,7 +767,6 @@ static u32 kaweth_get_link(struct net_device *dev)
|
||||
}
|
||||
|
||||
static const struct ethtool_ops ops = {
|
||||
.get_drvinfo = kaweth_get_drvinfo,
|
||||
.get_link = kaweth_get_link
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user