Received: by 10.223.164.221 with SMTP id h29csp2059146wrb; Thu, 2 Nov 2017 05:21:02 -0700 (PDT) X-Google-Smtp-Source: ABhQp+ShwAQ+aoSyRZ3Ht63JoZqqzQhAoOfoeCj/bGvagEfYHefV9n7qnkgq5LGXUdiQtBjevJPr X-Received: by 10.84.239.22 with SMTP id w22mr3034324plk.24.1509625262501; Thu, 02 Nov 2017 05:21:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509625262; cv=none; d=google.com; s=arc-20160816; b=Z8snn4XLwK+V/0NAYHzUOEroNFyQpY8LN3ItAa+7V7C90/X4BgIyaXDKo3cH1VgptD PGavAB/KsWk9AKspq/qSNV3IoAbjyGH9qVKxOT93tzrSaaieUT/cnW7OuElKkg499xg5 PqAqAXwdWIpvTtL1G/L8TG7vng4WtzvNG3RVVnNeLrLIQ1pPVYyLmbVLTaO5KuNXnu8T r+rsY9fDBPX8xabwCvA47nbKL7jL0pei2k54orjViN9KsC9PUcJL6+71Dhsh5BaJCx0R MgR5eC1OwU5js2EDnK9+5EMdxsekK8XwfwKDVQ3b3Ca1t8evsp6SE0Z4q6YGZ2mGeWsI Tw3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=G1BpABCFIL08qPcNU3XoJ8rscLbgdlgoL5tLf5z5vlE=; b=RFD4VApvMoOaRRvJtBonuKmmgzCviU4BkqDPLYjck2YOSaxlDFxgp565vDzU2U0KCr 7sD7D2ry1HMp3gsor1xIimsjzUk3sxjbpqzBh91Q0jVS533hh4d6RL1JCQZ6vILM2BXd xqZv1vXBc64BgFilXstbyvAaRfGkVDLKQmkWxMI0m9ENjWbxK0SAV17Iqs68hxh2XrlD 1uDLk5xVzAUvPamdoVpvxI9I8SxgOoiDQj0Cc1Vv+726jKbOxzOugE9NWEB2NYGfsuVU jQbiUUyI+faxKUPOL6WjuEllJYoyk3q3+VIqaoHEG7sHulzdI8AsEEfc8u7dYp8ymX7J frFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si3664249pfg.275.2017.11.02.05.20.31; Thu, 02 Nov 2017 05:21:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755382AbdKBMTM (ORCPT + 96 others); Thu, 2 Nov 2017 08:19:12 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:51494 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754773AbdKBMTG (ORCPT ); Thu, 2 Nov 2017 08:19:06 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BEDB0258048A4; Thu, 2 Nov 2017 20:18:50 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.361.1; Thu, 2 Nov 2017 20:17:47 +0800 From: Lipeng To: CC: , , , , Subject: [PATCH V2 net-next 2/9] net: hns3: Refactor mac_init function Date: Thu, 2 Nov 2017 20:45:16 +0800 Message-ID: <1509626723-18619-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1509626723-18619-1-git-send-email-lipeng321@huawei.com> References: <1509626723-18619-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.71.200.31] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: qumingguang 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 Signed-off-by: Lipeng Signed-off-by: Yunsheng Lin --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 404757a..5daa8c7 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -2228,13 +2228,6 @@ static int hclge_mac_init(struct hclge_dev *hdev) mac->link = 0; - ret = hclge_mac_mdio_config(hdev); - if (ret) { - dev_warn(&hdev->pdev->dev, - "mdio config fail ret=%d\n", ret); - return ret; - } - /* Initialize the MTA table work mode */ hdev->accept_mta_mc = true; hdev->enable_mta = true; @@ -4498,6 +4491,13 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) return ret; } + ret = hclge_mac_mdio_config(hdev); + if (ret) { + dev_warn(&hdev->pdev->dev, + "mdio config fail ret=%d\n", ret); + return ret; + } + ret = hclge_mac_init(hdev); if (ret) { dev_err(&pdev->dev, "Mac init error, ret = %d\n", ret); -- 1.9.1 From 1582963982502889624@xxx Thu Nov 02 14:14:53 +0000 2017 X-GM-THRID: 1581376832940617522 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread