Skip to content

Commit

Permalink
net: ethernet: nb8800: use phy_ethtool_{get|set}_link_ksettings
Browse files Browse the repository at this point in the history
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>
Acked-by: Mans Rullgard <mans@mansr.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Philippe Reynes authored and David S. Miller committed Jun 19, 2016
1 parent 46bb0bb commit 9078932
Showing 1 changed file with 2 additions and 22 deletions.
24 changes: 2 additions & 22 deletions drivers/net/ethernet/aurora/nb8800.c
Original file line number Diff line number Diff line change
Expand Up @@ -1035,26 +1035,6 @@ static const struct net_device_ops nb8800_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
};

static int nb8800_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct phy_device *phydev = dev->phydev;

if (!phydev)
return -ENODEV;

return phy_ethtool_gset(phydev, cmd);
}

static int nb8800_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct phy_device *phydev = dev->phydev;

if (!phydev)
return -ENODEV;

return phy_ethtool_sset(phydev, cmd);
}

static int nb8800_nway_reset(struct net_device *dev)
{
struct phy_device *phydev = dev->phydev;
Expand Down Expand Up @@ -1183,15 +1163,15 @@ static void nb8800_get_ethtool_stats(struct net_device *dev,
}

static const struct ethtool_ops nb8800_ethtool_ops = {
.get_settings = nb8800_get_settings,
.set_settings = nb8800_set_settings,
.nway_reset = nb8800_nway_reset,
.get_link = ethtool_op_get_link,
.get_pauseparam = nb8800_get_pauseparam,
.set_pauseparam = nb8800_set_pauseparam,
.get_sset_count = nb8800_get_sset_count,
.get_strings = nb8800_get_strings,
.get_ethtool_stats = nb8800_get_ethtool_stats,
.get_link_ksettings = phy_ethtool_get_link_ksettings,
.set_link_ksettings = phy_ethtool_set_link_ksettings,
};

static int nb8800_hw_init(struct net_device *dev)
Expand Down

0 comments on commit 9078932

Please sign in to comment.