aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Reynes <tremyfr@gmail.com>2016-06-27 18:08:12 -0400
committerDavid S. Miller <davem@davemloft.net>2016-06-29 06:03:39 -0400
commitfb773e975e80a04cb7c0cfd0c1aea2dca095e968 (patch)
tree8e0001421377abe335e61fc46c8033a3c12d78fa
parent8e07269de1fd09a01a2c00aba68b0c13160a6bac (diff)
net: ethernet: mvpp2: use phy_ethtool_{get|set}_link_ksettings
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>
-rw-r--r--drivers/net/ethernet/marvell/mvpp2.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c
index 18477fe29394..0b047178cda1 100644
--- a/drivers/net/ethernet/marvell/mvpp2.c
+++ b/drivers/net/ethernet/marvell/mvpp2.c
@@ -5813,24 +5813,6 @@ static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
5813 5813
5814/* Ethtool methods */ 5814/* Ethtool methods */
5815 5815
5816/* Get settings (phy address, speed) for ethtools */
5817static int mvpp2_ethtool_get_settings(struct net_device *dev,
5818 struct ethtool_cmd *cmd)
5819{
5820 if (!dev->phydev)
5821 return -ENODEV;
5822 return phy_ethtool_gset(dev->phydev, cmd);
5823}
5824
5825/* Set settings (phy address, speed) for ethtools */
5826static int mvpp2_ethtool_set_settings(struct net_device *dev,
5827 struct ethtool_cmd *cmd)
5828{
5829 if (!dev->phydev)
5830 return -ENODEV;
5831 return phy_ethtool_sset(dev->phydev, cmd);
5832}
5833
5834/* Set interrupt coalescing for ethtools */ 5816/* Set interrupt coalescing for ethtools */
5835static int mvpp2_ethtool_set_coalesce(struct net_device *dev, 5817static int mvpp2_ethtool_set_coalesce(struct net_device *dev,
5836 struct ethtool_coalesce *c) 5818 struct ethtool_coalesce *c)
@@ -5965,13 +5947,13 @@ static const struct net_device_ops mvpp2_netdev_ops = {
5965 5947
5966static const struct ethtool_ops mvpp2_eth_tool_ops = { 5948static const struct ethtool_ops mvpp2_eth_tool_ops = {
5967 .get_link = ethtool_op_get_link, 5949 .get_link = ethtool_op_get_link,
5968 .get_settings = mvpp2_ethtool_get_settings,
5969 .set_settings = mvpp2_ethtool_set_settings,
5970 .set_coalesce = mvpp2_ethtool_set_coalesce, 5950 .set_coalesce = mvpp2_ethtool_set_coalesce,
5971 .get_coalesce = mvpp2_ethtool_get_coalesce, 5951 .get_coalesce = mvpp2_ethtool_get_coalesce,
5972 .get_drvinfo = mvpp2_ethtool_get_drvinfo, 5952 .get_drvinfo = mvpp2_ethtool_get_drvinfo,
5973 .get_ringparam = mvpp2_ethtool_get_ringparam, 5953 .get_ringparam = mvpp2_ethtool_get_ringparam,
5974 .set_ringparam = mvpp2_ethtool_set_ringparam, 5954 .set_ringparam = mvpp2_ethtool_set_ringparam,
5955 .get_link_ksettings = phy_ethtool_get_link_ksettings,
5956 .set_link_ksettings = phy_ethtool_set_link_ksettings,
5975}; 5957};
5976 5958
5977/* Driver initialization */ 5959/* Driver initialization */