net: convert suitable drivers to use phy_do_ioctl_running
Convert suitable drivers to use new helper phy_do_ioctl_running. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Acked-by: Timur Tabi <timur@kernel.org> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
954b3c4397
commit
fd786fb1d2
@@ -675,18 +675,6 @@ static void hisi_femac_net_set_rx_mode(struct net_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static int hisi_femac_net_ioctl(struct net_device *dev,
|
||||
struct ifreq *ifreq, int cmd)
|
||||
{
|
||||
if (!netif_running(dev))
|
||||
return -EINVAL;
|
||||
|
||||
if (!dev->phydev)
|
||||
return -EINVAL;
|
||||
|
||||
return phy_mii_ioctl(dev->phydev, ifreq, cmd);
|
||||
}
|
||||
|
||||
static const struct ethtool_ops hisi_femac_ethtools_ops = {
|
||||
.get_link = ethtool_op_get_link,
|
||||
.get_link_ksettings = phy_ethtool_get_link_ksettings,
|
||||
@@ -697,7 +685,7 @@ static const struct net_device_ops hisi_femac_netdev_ops = {
|
||||
.ndo_open = hisi_femac_net_open,
|
||||
.ndo_stop = hisi_femac_net_close,
|
||||
.ndo_start_xmit = hisi_femac_net_xmit,
|
||||
.ndo_do_ioctl = hisi_femac_net_ioctl,
|
||||
.ndo_do_ioctl = phy_do_ioctl_running,
|
||||
.ndo_set_mac_address = hisi_femac_set_mac_address,
|
||||
.ndo_set_rx_mode = hisi_femac_net_set_rx_mode,
|
||||
};
|
||||
|
||||
@@ -1497,20 +1497,6 @@ static void hns_nic_net_timeout(struct net_device *ndev, unsigned int txqueue)
|
||||
}
|
||||
}
|
||||
|
||||
static int hns_nic_do_ioctl(struct net_device *netdev, struct ifreq *ifr,
|
||||
int cmd)
|
||||
{
|
||||
struct phy_device *phy_dev = netdev->phydev;
|
||||
|
||||
if (!netif_running(netdev))
|
||||
return -EINVAL;
|
||||
|
||||
if (!phy_dev)
|
||||
return -ENOTSUPP;
|
||||
|
||||
return phy_mii_ioctl(phy_dev, ifr, cmd);
|
||||
}
|
||||
|
||||
static netdev_tx_t hns_nic_net_xmit(struct sk_buff *skb,
|
||||
struct net_device *ndev)
|
||||
{
|
||||
@@ -1958,7 +1944,7 @@ static const struct net_device_ops hns_nic_netdev_ops = {
|
||||
.ndo_tx_timeout = hns_nic_net_timeout,
|
||||
.ndo_set_mac_address = hns_nic_net_set_mac_address,
|
||||
.ndo_change_mtu = hns_nic_change_mtu,
|
||||
.ndo_do_ioctl = hns_nic_do_ioctl,
|
||||
.ndo_do_ioctl = phy_do_ioctl_running,
|
||||
.ndo_set_features = hns_nic_set_features,
|
||||
.ndo_fix_features = hns_nic_fix_features,
|
||||
.ndo_get_stats64 = hns_nic_get_stats64,
|
||||
|
||||
Reference in New Issue
Block a user