aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2010-08-17 05:31:15 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-17 05:31:15 -0400
commit01414802054c382072b6cb9a1bdc6e243c74b2d5 (patch)
treef09b05eb9fff16a69d83ec28653992d1bae8d74c /drivers/net/usb
parentbb8a10bbd10a45db0eb45bac520489bdbc0917ef (diff)
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>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/hso.c9
-rw-r--r--drivers/net/usb/kaweth.c9
2 files changed, 0 insertions, 18 deletions
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 6efca66b8766..4f123f869bdc 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -843,16 +843,7 @@ static netdev_tx_t hso_net_start_xmit(struct sk_buff *skb,
843 return NETDEV_TX_OK; 843 return NETDEV_TX_OK;
844} 844}
845 845
846static void hso_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *info)
847{
848 struct hso_net *odev = netdev_priv(net);
849
850 strncpy(info->driver, driver_name, ETHTOOL_BUSINFO_LEN);
851 usb_make_path(odev->parent->usb, info->bus_info, sizeof info->bus_info);
852}
853
854static const struct ethtool_ops ops = { 846static const struct ethtool_ops ops = {
855 .get_drvinfo = hso_get_drvinfo,
856 .get_link = ethtool_op_get_link 847 .get_link = ethtool_op_get_link
857}; 848};
858 849
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 2b7b39cad1ce..5e98643a4a21 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -759,14 +759,6 @@ static int kaweth_close(struct net_device *net)
759 return 0; 759 return 0;
760} 760}
761 761
762static void kaweth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
763{
764 struct kaweth_device *kaweth = netdev_priv(dev);
765
766 strlcpy(info->driver, driver_name, sizeof(info->driver));
767 usb_make_path(kaweth->dev, info->bus_info, sizeof (info->bus_info));
768}
769
770static u32 kaweth_get_link(struct net_device *dev) 762static u32 kaweth_get_link(struct net_device *dev)
771{ 763{
772 struct kaweth_device *kaweth = netdev_priv(dev); 764 struct kaweth_device *kaweth = netdev_priv(dev);
@@ -775,7 +767,6 @@ static u32 kaweth_get_link(struct net_device *dev)
775} 767}
776 768
777static const struct ethtool_ops ops = { 769static const struct ethtool_ops ops = {
778 .get_drvinfo = kaweth_get_drvinfo,
779 .get_link = kaweth_get_link 770 .get_link = kaweth_get_link
780}; 771};
781 772