Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Philippe Reynes and committed by
David S. Miller
cb90d3e1 f786f356

+2 -24
+2 -24
drivers/net/ethernet/nxp/lpc_eth.c
··· 1245 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 1248 static const struct ethtool_ops lpc_eth_ethtool_ops = { 1271 1249 .get_drvinfo = lpc_eth_ethtool_getdrvinfo, 1272 - .get_settings = lpc_eth_ethtool_getsettings, 1273 - .set_settings = lpc_eth_ethtool_setsettings, 1274 1250 .get_msglevel = lpc_eth_ethtool_getmsglevel, 1275 1251 .set_msglevel = lpc_eth_ethtool_setmsglevel, 1276 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 1257 static const struct net_device_ops lpc_netdev_ops = {