diff options
author | Philippe Reynes <tremyfr@gmail.com> | 2016-06-28 17:59:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-29 08:15:33 -0400 |
commit | cb90d3e15de20e44ec77c92c0a1cb2ae47a5a27f (patch) | |
tree | bb4232e15e481e425ea9cf4a21c973e67a8c20b8 | |
parent | f786f3564c4f02d5026189d4e4fc5e544d125a0c (diff) |
net: ethernet: lpc_eth: 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/nxp/lpc_eth.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c index b00350157d9e..01b50ff7c708 100644 --- a/drivers/net/ethernet/nxp/lpc_eth.c +++ b/drivers/net/ethernet/nxp/lpc_eth.c | |||
@@ -1245,35 +1245,13 @@ static void lpc_eth_ethtool_setmsglevel(struct net_device *ndev, u32 level) | |||
1245 | pldat->msg_enable = level; | 1245 | pldat->msg_enable = level; |
1246 | } | 1246 | } |
1247 | 1247 | ||
1248 | static int lpc_eth_ethtool_getsettings(struct net_device *ndev, | ||
1249 | struct ethtool_cmd *cmd) | ||
1250 | { | ||
1251 | struct phy_device *phydev = ndev->phydev; | ||
1252 | |||
1253 | if (!phydev) | ||
1254 | return -EOPNOTSUPP; | ||
1255 | |||
1256 | return phy_ethtool_gset(phydev, cmd); | ||
1257 | } | ||
1258 | |||
1259 | static int lpc_eth_ethtool_setsettings(struct net_device *ndev, | ||
1260 | struct ethtool_cmd *cmd) | ||
1261 | { | ||
1262 | struct phy_device *phydev = ndev->phydev; | ||
1263 | |||
1264 | if (!phydev) | ||
1265 | return -EOPNOTSUPP; | ||
1266 | |||
1267 | return phy_ethtool_sset(phydev, cmd); | ||
1268 | } | ||
1269 | |||
1270 | static const struct ethtool_ops lpc_eth_ethtool_ops = { | 1248 | static const struct ethtool_ops lpc_eth_ethtool_ops = { |
1271 | .get_drvinfo = lpc_eth_ethtool_getdrvinfo, | 1249 | .get_drvinfo = lpc_eth_ethtool_getdrvinfo, |
1272 | .get_settings = lpc_eth_ethtool_getsettings, | ||
1273 | .set_settings = lpc_eth_ethtool_setsettings, | ||
1274 | .get_msglevel = lpc_eth_ethtool_getmsglevel, | 1250 | .get_msglevel = lpc_eth_ethtool_getmsglevel, |
1275 | .set_msglevel = lpc_eth_ethtool_setmsglevel, | 1251 | .set_msglevel = lpc_eth_ethtool_setmsglevel, |
1276 | .get_link = ethtool_op_get_link, | 1252 | .get_link = ethtool_op_get_link, |
1253 | .get_link_ksettings = phy_ethtool_get_link_ksettings, | ||
1254 | .set_link_ksettings = phy_ethtool_set_link_ksettings, | ||
1277 | }; | 1255 | }; |
1278 | 1256 | ||
1279 | static const struct net_device_ops lpc_netdev_ops = { | 1257 | static const struct net_device_ops lpc_netdev_ops = { |