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
@@ -90,21 +90,6 @@ pasemi_mac_ethtool_set_settings(struct net_device *netdev,
|
||||
return phy_ethtool_sset(phydev, cmd);
|
||||
}
|
||||
|
||||
static void
|
||||
pasemi_mac_ethtool_get_drvinfo(struct net_device *netdev,
|
||||
struct ethtool_drvinfo *drvinfo)
|
||||
{
|
||||
struct pasemi_mac *mac;
|
||||
mac = netdev_priv(netdev);
|
||||
|
||||
/* clear and fill out info */
|
||||
memset(drvinfo, 0, sizeof(struct ethtool_drvinfo));
|
||||
strncpy(drvinfo->driver, "pasemi_mac", 12);
|
||||
strcpy(drvinfo->version, "N/A");
|
||||
strcpy(drvinfo->fw_version, "N/A");
|
||||
strncpy(drvinfo->bus_info, pci_name(mac->pdev), 32);
|
||||
}
|
||||
|
||||
static u32
|
||||
pasemi_mac_ethtool_get_msglevel(struct net_device *netdev)
|
||||
{
|
||||
@@ -164,7 +149,6 @@ static void pasemi_mac_get_strings(struct net_device *netdev, u32 stringset,
|
||||
const struct ethtool_ops pasemi_mac_ethtool_ops = {
|
||||
.get_settings = pasemi_mac_ethtool_get_settings,
|
||||
.set_settings = pasemi_mac_ethtool_set_settings,
|
||||
.get_drvinfo = pasemi_mac_ethtool_get_drvinfo,
|
||||
.get_msglevel = pasemi_mac_ethtool_get_msglevel,
|
||||
.set_msglevel = pasemi_mac_ethtool_set_msglevel,
|
||||
.get_link = ethtool_op_get_link,
|
||||
|
Reference in New Issue
Block a user