aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/hisilicon/hns3
diff options
context:
space:
mode:
authorFuyun Liang <liangfuyun1@huawei.com>2018-03-21 15:49:30 +0800
committerDavid S. Miller <davem@davemloft.net>2018-03-22 13:12:03 -0400
commit1931dc20839e31af758a5f110f31200f2ea15539 (patch)
treec03c1182a13480b5efd350320f806bae10394c6f /drivers/net/ethernet/hisilicon/hns3
parentnet: hns3: add querying speed and duplex support to VF (diff)
downloadlinux-dev-1931dc20839e31af758a5f110f31200f2ea15539.tar.xz
linux-dev-1931dc20839e31af758a5f110f31200f2ea15539.zip
net: hns3: fix for not returning problem in get_link_ksettings when phy exists
When phy exists, phy_ethtool_ksettings_get function is enough to get the link ksettings. If the phy exists, get_link_ksettings function can return directly after phy_ethtool_ksettings_get is called. Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index 513d8d6dd1ad..9d07116a4426 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -569,9 +569,13 @@ static int hns3_get_link_ksettings(struct net_device *netdev,
return -EOPNOTSUPP;
/* 1.auto_neg & speed & duplex from cmd */
- if (netdev->phydev)
+ if (netdev->phydev) {
phy_ethtool_ksettings_get(netdev->phydev, cmd);
- else if (h->ae_algo->ops->get_ksettings_an_result)
+
+ return 0;
+ }
+
+ if (h->ae_algo->ops->get_ksettings_an_result)
h->ae_algo->ops->get_ksettings_an_result(h,
&cmd->base.autoneg,
&cmd->base.speed,