Skip to content

Commit f129461

Browse files
hkallweitdavem330
authored andcommitted
net: convert suitable network drivers to use phy_do_ioctl
Convert suitable network drivers to use phy_do_ioctl. Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent bbbf843 commit f129461

File tree

5 files changed

+5
-49
lines changed

5 files changed

+5
-49
lines changed

drivers/net/ethernet/agere/et131x.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,15 +3651,6 @@ static int et131x_close(struct net_device *netdev)
36513651
return del_timer_sync(&adapter->error_timer);
36523652
}
36533653

3654-
static int et131x_ioctl(struct net_device *netdev, struct ifreq *reqbuf,
3655-
int cmd)
3656-
{
3657-
if (!netdev->phydev)
3658-
return -EINVAL;
3659-
3660-
return phy_mii_ioctl(netdev->phydev, reqbuf, cmd);
3661-
}
3662-
36633654
/* et131x_set_packet_filter - Configures the Rx Packet filtering */
36643655
static int et131x_set_packet_filter(struct et131x_adapter *adapter)
36653656
{
@@ -3899,7 +3890,7 @@ static const struct net_device_ops et131x_netdev_ops = {
38993890
.ndo_set_mac_address = eth_mac_addr,
39003891
.ndo_validate_addr = eth_validate_addr,
39013892
.ndo_get_stats = et131x_stats,
3902-
.ndo_do_ioctl = et131x_ioctl,
3893+
.ndo_do_ioctl = phy_do_ioctl,
39033894
};
39043895

39053896
static int et131x_pci_setup(struct pci_dev *pdev,

drivers/net/ethernet/atheros/ag71xx.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,14 +1394,6 @@ static netdev_tx_t ag71xx_hard_start_xmit(struct sk_buff *skb,
13941394
return NETDEV_TX_OK;
13951395
}
13961396

1397-
static int ag71xx_do_ioctl(struct net_device *ndev, struct ifreq *ifr, int cmd)
1398-
{
1399-
if (!ndev->phydev)
1400-
return -EINVAL;
1401-
1402-
return phy_mii_ioctl(ndev->phydev, ifr, cmd);
1403-
}
1404-
14051397
static void ag71xx_oom_timer_handler(struct timer_list *t)
14061398
{
14071399
struct ag71xx *ag = from_timer(ag, t, oom_timer);
@@ -1618,7 +1610,7 @@ static const struct net_device_ops ag71xx_netdev_ops = {
16181610
.ndo_open = ag71xx_open,
16191611
.ndo_stop = ag71xx_stop,
16201612
.ndo_start_xmit = ag71xx_hard_start_xmit,
1621-
.ndo_do_ioctl = ag71xx_do_ioctl,
1613+
.ndo_do_ioctl = phy_do_ioctl,
16221614
.ndo_tx_timeout = ag71xx_tx_timeout,
16231615
.ndo_change_mtu = ag71xx_change_mtu,
16241616
.ndo_set_mac_address = eth_mac_addr,

drivers/net/ethernet/faraday/ftgmac100.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,15 +1536,6 @@ static int ftgmac100_stop(struct net_device *netdev)
15361536
return 0;
15371537
}
15381538

1539-
/* optional */
1540-
static int ftgmac100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
1541-
{
1542-
if (!netdev->phydev)
1543-
return -ENXIO;
1544-
1545-
return phy_mii_ioctl(netdev->phydev, ifr, cmd);
1546-
}
1547-
15481539
static void ftgmac100_tx_timeout(struct net_device *netdev, unsigned int txqueue)
15491540
{
15501541
struct ftgmac100 *priv = netdev_priv(netdev);
@@ -1597,7 +1588,7 @@ static const struct net_device_ops ftgmac100_netdev_ops = {
15971588
.ndo_start_xmit = ftgmac100_hard_start_xmit,
15981589
.ndo_set_mac_address = ftgmac100_set_mac_addr,
15991590
.ndo_validate_addr = eth_validate_addr,
1600-
.ndo_do_ioctl = ftgmac100_do_ioctl,
1591+
.ndo_do_ioctl = phy_do_ioctl,
16011592
.ndo_tx_timeout = ftgmac100_tx_timeout,
16021593
.ndo_set_rx_mode = ftgmac100_set_rx_mode,
16031594
.ndo_set_features = ftgmac100_set_features,

drivers/net/ethernet/freescale/fec_mpc52xx.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -785,24 +785,14 @@ static const struct ethtool_ops mpc52xx_fec_ethtool_ops = {
785785
};
786786

787787

788-
static int mpc52xx_fec_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
789-
{
790-
struct phy_device *phydev = dev->phydev;
791-
792-
if (!phydev)
793-
return -ENOTSUPP;
794-
795-
return phy_mii_ioctl(phydev, rq, cmd);
796-
}
797-
798788
static const struct net_device_ops mpc52xx_fec_netdev_ops = {
799789
.ndo_open = mpc52xx_fec_open,
800790
.ndo_stop = mpc52xx_fec_close,
801791
.ndo_start_xmit = mpc52xx_fec_start_xmit,
802792
.ndo_set_rx_mode = mpc52xx_fec_set_multicast_list,
803793
.ndo_set_mac_address = mpc52xx_fec_set_mac_address,
804794
.ndo_validate_addr = eth_validate_addr,
805-
.ndo_do_ioctl = mpc52xx_fec_ioctl,
795+
.ndo_do_ioctl = phy_do_ioctl,
806796
.ndo_tx_timeout = mpc52xx_fec_tx_timeout,
807797
.ndo_get_stats = mpc52xx_fec_get_stats,
808798
#ifdef CONFIG_NET_POLL_CONTROLLER

drivers/net/ethernet/rdc/r6040.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -498,14 +498,6 @@ static int r6040_close(struct net_device *dev)
498498
return 0;
499499
}
500500

501-
static int r6040_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
502-
{
503-
if (!dev->phydev)
504-
return -EINVAL;
505-
506-
return phy_mii_ioctl(dev->phydev, rq, cmd);
507-
}
508-
509501
static int r6040_rx(struct net_device *dev, int limit)
510502
{
511503
struct r6040_private *priv = netdev_priv(dev);
@@ -957,7 +949,7 @@ static const struct net_device_ops r6040_netdev_ops = {
957949
.ndo_set_rx_mode = r6040_multicast_list,
958950
.ndo_validate_addr = eth_validate_addr,
959951
.ndo_set_mac_address = eth_mac_addr,
960-
.ndo_do_ioctl = r6040_ioctl,
952+
.ndo_do_ioctl = phy_do_ioctl,
961953
.ndo_tx_timeout = r6040_tx_timeout,
962954
#ifdef CONFIG_NET_POLL_CONTROLLER
963955
.ndo_poll_controller = r6040_poll_controller,

0 commit comments

Comments
 (0)