Skip to content

Commit cf9cca2

Browse files
qumingguangdavem330
authored andcommitted
net: hns3: Refactor mac_init function
It needs initialize mdio in initialization process, but reset process does not reset mdio, so do not initialize mdio in reset process. This patch move out the mdio configuration function from the mac_init. So mac_init can be used both in reset process and initialization process. Signed-off-by: qumingguang <[email protected]> Signed-off-by: Lipeng <[email protected]> Signed-off-by: Yunsheng Lin <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7df7dad commit cf9cca2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,13 +2228,6 @@ static int hclge_mac_init(struct hclge_dev *hdev)
22282228

22292229
mac->link = 0;
22302230

2231-
ret = hclge_mac_mdio_config(hdev);
2232-
if (ret) {
2233-
dev_warn(&hdev->pdev->dev,
2234-
"mdio config fail ret=%d\n", ret);
2235-
return ret;
2236-
}
2237-
22382231
/* Initialize the MTA table work mode */
22392232
hdev->accept_mta_mc = true;
22402233
hdev->enable_mta = true;
@@ -4498,6 +4491,13 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
44984491
return ret;
44994492
}
45004493

4494+
ret = hclge_mac_mdio_config(hdev);
4495+
if (ret) {
4496+
dev_warn(&hdev->pdev->dev,
4497+
"mdio config fail ret=%d\n", ret);
4498+
return ret;
4499+
}
4500+
45014501
ret = hclge_mac_init(hdev);
45024502
if (ret) {
45034503
dev_err(&pdev->dev, "Mac init error, ret = %d\n", ret);

0 commit comments

Comments
 (0)