[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1462743877-31738-4-git-send-email-tremyfr@gmail.com>
Date: Sun, 8 May 2016 23:44:37 +0200
From: Philippe Reynes <tremyfr@...il.com>
To: fugang.duan@....com, davem@...emloft.net, ben@...adent.org.uk,
kan.liang@...el.com, decot@...glers.com, aduyck@...antis.com,
jiri@...lanox.com, jacob.e.keller@...el.com, tom@...bertland.com,
andrew@...n.ch
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Philippe Reynes <tremyfr@...il.com>
Subject: [PATCH v2 3/3] net: ethernet: fec: use ethtool_op_{get|set}_link_ksettings
There are two generics functions ethtool_op_{get|set}_link_ksettings,
so we can use them instead of defining the same code in the driver.
Signed-off-by: Philippe Reynes <tremyfr@...il.com>
---
drivers/net/ethernet/freescale/fec_main.c | 26 ++------------------------
1 files changed, 2 insertions(+), 24 deletions(-)
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index e1d24ff..f2dae6c 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -2055,28 +2055,6 @@ static void fec_enet_mii_remove(struct fec_enet_private *fep)
}
}
-static int fec_enet_get_link_ksettings(struct net_device *ndev,
- struct ethtool_link_ksettings *cmd)
-{
- struct phy_device *phydev = ndev->phydev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_ksettings_get(phydev, cmd);
-}
-
-static int fec_enet_set_link_ksettings(struct net_device *ndev,
- const struct ethtool_link_ksettings *cmd)
-{
- struct phy_device *phydev = ndev->phydev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_ksettings_set(phydev, cmd);
-}
-
static void fec_enet_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
@@ -2575,8 +2553,8 @@ static const struct ethtool_ops fec_enet_ethtool_ops = {
.set_tunable = fec_enet_set_tunable,
.get_wol = fec_enet_get_wol,
.set_wol = fec_enet_set_wol,
- .get_link_ksettings = fec_enet_get_link_ksettings,
- .set_link_ksettings = fec_enet_set_link_ksettings,
+ .get_link_ksettings = ethtool_op_get_link_ksettings,
+ .set_link_ksettings = ethtool_op_set_link_ksettings,
};
static int fec_enet_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
--
1.7.4.4
Powered by blists - more mailing lists