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

net: ethernet: smsc9420: 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
a1b198b7 5d872c50

+2 -22
+2 -22
drivers/net/ethernet/smsc/smsc9420.c
··· 231 231 return phy_mii_ioctl(dev->phydev, ifr, cmd); 232 232 } 233 233 234 - static int smsc9420_ethtool_get_settings(struct net_device *dev, 235 - struct ethtool_cmd *cmd) 236 - { 237 - if (!dev->phydev) 238 - return -ENODEV; 239 - 240 - cmd->maxtxpkt = 1; 241 - cmd->maxrxpkt = 1; 242 - return phy_ethtool_gset(dev->phydev, cmd); 243 - } 244 - 245 - static int smsc9420_ethtool_set_settings(struct net_device *dev, 246 - struct ethtool_cmd *cmd) 247 - { 248 - if (!dev->phydev) 249 - return -ENODEV; 250 - 251 - return phy_ethtool_sset(dev->phydev, cmd); 252 - } 253 - 254 234 static void smsc9420_ethtool_get_drvinfo(struct net_device *netdev, 255 235 struct ethtool_drvinfo *drvinfo) 256 236 { ··· 414 434 } 415 435 416 436 static const struct ethtool_ops smsc9420_ethtool_ops = { 417 - .get_settings = smsc9420_ethtool_get_settings, 418 - .set_settings = smsc9420_ethtool_set_settings, 419 437 .get_drvinfo = smsc9420_ethtool_get_drvinfo, 420 438 .get_msglevel = smsc9420_ethtool_get_msglevel, 421 439 .set_msglevel = smsc9420_ethtool_set_msglevel, ··· 425 447 .get_regs_len = smsc9420_ethtool_getregslen, 426 448 .get_regs = smsc9420_ethtool_getregs, 427 449 .get_ts_info = ethtool_op_get_ts_info, 450 + .get_link_ksettings = phy_ethtool_get_link_ksettings, 451 + .set_link_ksettings = phy_ethtool_set_link_ksettings, 428 452 }; 429 453 430 454 /* Sets the device MAC address to dev_addr */