net: usb: ax88172x: use phy_ethtool_{get|set}_link_ksettings
authorPhilippe Reynes <tremyfr@gmail.com>
Fri, 15 Jul 2016 13:25:36 +0000 (15:25 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Jul 2016 04:54:40 +0000 (21:54 -0700)
There are two generics functions phy_ethtool_{get|set}_link_ksettings,
so we can use them instead of defining the same code in the driver.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/ax88172a.c

index cf77f2dffa698fa8399f5ae7b04162be8a1b34fe..163a2c576e698a9aa516a8985a3c9be74cdebf73 100644 (file)
@@ -149,24 +149,6 @@ static const struct net_device_ops ax88172a_netdev_ops = {
        .ndo_set_rx_mode        = asix_set_multicast,
 };
 
-static int ax88172a_get_settings(struct net_device *net,
-                                struct ethtool_cmd *cmd)
-{
-       if (!net->phydev)
-               return -ENODEV;
-
-       return phy_ethtool_gset(net->phydev, cmd);
-}
-
-static int ax88172a_set_settings(struct net_device *net,
-                                struct ethtool_cmd *cmd)
-{
-       if (!net->phydev)
-               return -ENODEV;
-
-       return phy_ethtool_sset(net->phydev, cmd);
-}
-
 static int ax88172a_nway_reset(struct net_device *net)
 {
        if (!net->phydev)
@@ -185,9 +167,9 @@ static const struct ethtool_ops ax88172a_ethtool_ops = {
        .get_eeprom_len         = asix_get_eeprom_len,
        .get_eeprom             = asix_get_eeprom,
        .set_eeprom             = asix_set_eeprom,
-       .get_settings           = ax88172a_get_settings,
-       .set_settings           = ax88172a_set_settings,
        .nway_reset             = ax88172a_nway_reset,
+       .get_link_ksettings     = phy_ethtool_get_link_ksettings,
+       .set_link_ksettings     = phy_ethtool_set_link_ksettings,
 };
 
 static int ax88172a_reset_phy(struct usbnet *dev, int embd_phy)