diff options
author | Fuyun Liang <liangfuyun1@huawei.com> | 2017-11-08 15:52:23 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-11 15:17:56 +0900 |
commit | c040366bc4a58f719e61111dea4b550b71b2a0b4 (patch) | |
tree | 5f518f58026c9126dbe51f9d6ee71e416743346f | |
parent | 39e2151f1012eb4163b3a9f414c27d92798e4cbe (diff) | |
download | linux-c040366bc4a58f719e61111dea4b550b71b2a0b4.tar.gz linux-c040366bc4a58f719e61111dea4b550b71b2a0b4.tar.bz2 linux-c040366bc4a58f719e61111dea4b550b71b2a0b4.zip |
net: hns3: cleanup mac auto-negotiation state query in hclge_update_speed_duplex
When checking whether auto-negotiation is on, driver only needs to
check the value of mac.autoneg(SW) directly, and does not need to
query it from hardware. Because this value is always synchronized
with the auto-negotiation state of hardware.
This patch removes mac auto-negotiation state query in
hclge_update_speed_duplex().
Fixes: 46a3df9f9718 (net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support)
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Lipeng <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c6ba89089ef3..781d5a8cbb6a 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2325,18 +2325,7 @@ static int hclge_update_speed_duplex(struct hclge_dev *hdev) /* get the speed and duplex as autoneg'result from mac cmd when phy * doesn't exit. */ - if (mac.phydev) - return 0; - - /* update mac->antoneg. */ - ret = hclge_query_autoneg_result(hdev); - if (ret) { - dev_err(&hdev->pdev->dev, - "autoneg result query failed %d\n", ret); - return ret; - } - - if (!mac.autoneg) + if (mac.phydev || !mac.autoneg) return 0; ret = hclge_query_mac_an_speed_dup(hdev, &speed, &duplex); |