提交 19949f3c 编写于 作者: G Guangbin Huang 提交者: Yang Yingliang

net: hns3: optimize parameter of hclge_phy_link_status_wait() function

driver inclusion
category: bugfix
bugzilla: NA
CVE: NA

This patch deletes the parameter phydev of hclge_phy_link_status_wait()
function for optimization, as it can be gotten by hdev->hw.mac.phydev.
Signed-off-by: NGuangbin Huang <huangguangbin2@huawei.com>
Reviewed-by: NPeng Li <lipeng321@huawei.com>
Reviewed-by: NZhong Zhaohui <zhongzhaohui@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 990876f8
...@@ -6525,10 +6525,11 @@ static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, u8 value, ...@@ -6525,10 +6525,11 @@ static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, u8 value,
} }
static void hclge_phy_link_status_wait(struct hclge_dev *hdev, static void hclge_phy_link_status_wait(struct hclge_dev *hdev,
struct phy_device *phydev, int link_ret) int link_ret)
{ {
#define HCLGE_PHY_LINK_STATUS_NUM 200 #define HCLGE_PHY_LINK_STATUS_NUM 200
struct phy_device *phydev = hdev->hw.mac.phydev;
int i = 0; int i = 0;
int ret; int ret;
...@@ -6571,13 +6572,12 @@ static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en, ...@@ -6571,13 +6572,12 @@ static int hclge_mac_phy_link_status_wait(struct hclge_dev *hdev, bool en,
#define HCLGE_LINK_STATUS_DOWN 0 #define HCLGE_LINK_STATUS_DOWN 0
#define HCLGE_LINK_STATUS_UP 1 #define HCLGE_LINK_STATUS_UP 1
struct phy_device *phydev = hdev->hw.mac.phydev;
int link_ret; int link_ret;
link_ret = en ? HCLGE_LINK_STATUS_UP : HCLGE_LINK_STATUS_DOWN; link_ret = en ? HCLGE_LINK_STATUS_UP : HCLGE_LINK_STATUS_DOWN;
if (is_phy) if (is_phy)
hclge_phy_link_status_wait(hdev, phydev, link_ret); hclge_phy_link_status_wait(hdev, link_ret);
return hclge_mac_link_status_wait(hdev, link_ret); return hclge_mac_link_status_wait(hdev, link_ret);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册