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
@@ -1233,15 +1233,8 @@ static void bmac_reset_and_enable(struct net_device *dev)
|
||||
}
|
||||
spin_unlock_irqrestore(&bp->lock, flags);
|
||||
}
|
||||
static void bmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||
{
|
||||
struct bmac_data *bp = netdev_priv(dev);
|
||||
strcpy(info->driver, "bmac");
|
||||
strcpy(info->bus_info, dev_name(&bp->mdev->ofdev.dev));
|
||||
}
|
||||
|
||||
static const struct ethtool_ops bmac_ethtool_ops = {
|
||||
.get_drvinfo = bmac_get_drvinfo,
|
||||
.get_link = ethtool_op_get_link,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user