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

net: convert additional drivers to use phy_do_ioctl

The first batch of driver conversions missed a few cases where we can
use phy_do_ioctl too.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Heiner Kallweit and committed by
David S. Miller
c5d19a6e 4f2c17e0

+6 -37
+1 -6
drivers/net/ethernet/aurora/nb8800.c
··· 1005 1005 return 0; 1006 1006 } 1007 1007 1008 - static int nb8800_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 1009 - { 1010 - return phy_mii_ioctl(dev->phydev, rq, cmd); 1011 - } 1012 - 1013 1008 static const struct net_device_ops nb8800_netdev_ops = { 1014 1009 .ndo_open = nb8800_open, 1015 1010 .ndo_stop = nb8800_stop, 1016 1011 .ndo_start_xmit = nb8800_xmit, 1017 1012 .ndo_set_mac_address = nb8800_set_mac_address, 1018 1013 .ndo_set_rx_mode = nb8800_set_rx_mode, 1019 - .ndo_do_ioctl = nb8800_ioctl, 1014 + .ndo_do_ioctl = phy_do_ioctl, 1020 1015 .ndo_validate_addr = eth_validate_addr, 1021 1016 }; 1022 1017
+1 -3
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
··· 790 790 case SIOCSHWTSTAMP: 791 791 return octeon_mgmt_ioctl_hwtstamp(netdev, rq, cmd); 792 792 default: 793 - if (netdev->phydev) 794 - return phy_mii_ioctl(netdev->phydev, rq, cmd); 795 - return -EINVAL; 793 + return phy_do_ioctl(netdev, rq, cmd); 796 794 } 797 795 } 798 796
+1 -8
drivers/net/ethernet/lantiq_etop.c
··· 510 510 } 511 511 512 512 static int 513 - ltq_etop_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 514 - { 515 - /* TODO: mii-toll reports "No MII transceiver present!." ?!*/ 516 - return phy_mii_ioctl(dev->phydev, rq, cmd); 517 - } 518 - 519 - static int 520 513 ltq_etop_set_mac_address(struct net_device *dev, void *p) 521 514 { 522 515 int ret = eth_mac_addr(dev, p); ··· 609 616 .ndo_stop = ltq_etop_stop, 610 617 .ndo_start_xmit = ltq_etop_tx, 611 618 .ndo_change_mtu = ltq_etop_change_mtu, 612 - .ndo_do_ioctl = ltq_etop_ioctl, 619 + .ndo_do_ioctl = phy_do_ioctl, 613 620 .ndo_set_mac_address = ltq_etop_set_mac_address, 614 621 .ndo_validate_addr = eth_validate_addr, 615 622 .ndo_set_rx_mode = ltq_etop_set_multicast_list,
+1 -10
drivers/net/ethernet/marvell/pxa168_eth.c
··· 1344 1344 return 0; 1345 1345 } 1346 1346 1347 - static int pxa168_eth_do_ioctl(struct net_device *dev, struct ifreq *ifr, 1348 - int cmd) 1349 - { 1350 - if (dev->phydev) 1351 - return phy_mii_ioctl(dev->phydev, ifr, cmd); 1352 - 1353 - return -EOPNOTSUPP; 1354 - } 1355 - 1356 1347 #ifdef CONFIG_NET_POLL_CONTROLLER 1357 1348 static void pxa168_eth_netpoll(struct net_device *dev) 1358 1349 { ··· 1378 1387 .ndo_set_rx_mode = pxa168_eth_set_rx_mode, 1379 1388 .ndo_set_mac_address = pxa168_eth_set_mac_address, 1380 1389 .ndo_validate_addr = eth_validate_addr, 1381 - .ndo_do_ioctl = pxa168_eth_do_ioctl, 1390 + .ndo_do_ioctl = phy_do_ioctl, 1382 1391 .ndo_change_mtu = pxa168_eth_change_mtu, 1383 1392 .ndo_tx_timeout = pxa168_eth_tx_timeout, 1384 1393 #ifdef CONFIG_NET_POLL_CONTROLLER
+1 -3
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
··· 1939 1939 case SIOCGMIIPHY: 1940 1940 case SIOCGMIIREG: 1941 1941 case SIOCSMIIREG: 1942 - if (!dev->phydev) 1943 - return -EINVAL; 1944 - ret = phy_mii_ioctl(dev->phydev, rq, cmd); 1942 + ret = phy_do_ioctl(dev, rq, cmd); 1945 1943 break; 1946 1944 default: 1947 1945 break;
+1 -7
drivers/net/ethernet/socionext/netsec.c
··· 1740 1740 return 0; 1741 1741 } 1742 1742 1743 - static int netsec_netdev_ioctl(struct net_device *ndev, struct ifreq *ifr, 1744 - int cmd) 1745 - { 1746 - return phy_mii_ioctl(ndev->phydev, ifr, cmd); 1747 - } 1748 - 1749 1743 static int netsec_xdp_xmit(struct net_device *ndev, int n, 1750 1744 struct xdp_frame **frames, u32 flags) 1751 1745 { ··· 1824 1830 .ndo_set_features = netsec_netdev_set_features, 1825 1831 .ndo_set_mac_address = eth_mac_addr, 1826 1832 .ndo_validate_addr = eth_validate_addr, 1827 - .ndo_do_ioctl = netsec_netdev_ioctl, 1833 + .ndo_do_ioctl = phy_do_ioctl, 1828 1834 .ndo_xdp_xmit = netsec_xdp_xmit, 1829 1835 .ndo_bpf = netsec_xdp, 1830 1836 };