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

net: ethernet: cavium: octeon: 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
f4400ded 9e8e6e88

+2 -23
+2 -23
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
··· 1346 1346 strlcpy(info->bus_info, "N/A", sizeof(info->bus_info)); 1347 1347 } 1348 1348 1349 - static int octeon_mgmt_get_settings(struct net_device *netdev, 1350 - struct ethtool_cmd *cmd) 1351 - { 1352 - if (netdev->phydev) 1353 - return phy_ethtool_gset(netdev->phydev, cmd); 1354 - 1355 - return -EOPNOTSUPP; 1356 - } 1357 - 1358 - static int octeon_mgmt_set_settings(struct net_device *netdev, 1359 - struct ethtool_cmd *cmd) 1360 - { 1361 - if (!capable(CAP_NET_ADMIN)) 1362 - return -EPERM; 1363 - 1364 - if (netdev->phydev) 1365 - return phy_ethtool_sset(netdev->phydev, cmd); 1366 - 1367 - return -EOPNOTSUPP; 1368 - } 1369 - 1370 1349 static int octeon_mgmt_nway_reset(struct net_device *dev) 1371 1350 { 1372 1351 if (!capable(CAP_NET_ADMIN)) ··· 1359 1380 1360 1381 static const struct ethtool_ops octeon_mgmt_ethtool_ops = { 1361 1382 .get_drvinfo = octeon_mgmt_get_drvinfo, 1362 - .get_settings = octeon_mgmt_get_settings, 1363 - .set_settings = octeon_mgmt_set_settings, 1364 1383 .nway_reset = octeon_mgmt_nway_reset, 1365 1384 .get_link = ethtool_op_get_link, 1385 + .get_link_ksettings = phy_ethtool_get_link_ksettings, 1386 + .set_link_ksettings = phy_ethtool_set_link_ksettings, 1366 1387 }; 1367 1388 1368 1389 static const struct net_device_ops octeon_mgmt_ops = {