Received: by 10.213.65.68 with SMTP id h4csp1030875imn; Wed, 21 Mar 2018 00:20:33 -0700 (PDT) X-Google-Smtp-Source: AG47ELuiLwN0Z6ontXJMw9o9eXJYwwLR8QHpiA9r/AGKm4YtIYyHvO9x9DhQNi6s5iQzh/Jvdql/ X-Received: by 2002:a17:902:bd46:: with SMTP id b6-v6mr19318845plx.38.1521616833237; Wed, 21 Mar 2018 00:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521616833; cv=none; d=google.com; s=arc-20160816; b=I+WLXe2vSgnicG774t1yB8N9ifVK2rlWae1LdTN0f0jx7cMutwv5E4jUfNU1BnJStX lb6uS6Q2DzfLDw6HeyYeFizWKuSfQBe3nW3tzkKEoQ0nLqHWwku1/DilbzARRIQvLDjt FKY6EJpX4l73DM2KmDws2UMlUkmgotV5+xQ3Ox0ORY0PyPB/EC5WEWZCu4AL+9ehmGdd zLjLNORGKA5D6SOZQ2ZUymUgzkPsi244bih8cFJhJQYo3nEsjUpTspvzrCcbmonBQAzU 67a4iQ6PRC55Hxo03BlVkD8oOl43h1uxqTIvuq1a9z9qSwikTbfaO/n4kVaR2PjK2Y6i Uuog== 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=3Wsk2ztO+QhKOh4mcWI5IabzO+VdIbWA1pyD8coZFDA=; b=r9LkmgegtjqBwdeo85Wy6FzJea+a8DJKEIbZV2yepP6wfDbiLkLzt0orvVb7zOOFVv RXSLTq/e1trWLwi2HWB6vZDUXBKsmwO66MZgntN8DHp5D2/FWUVNQWidPcxtndMg6HAo p0Ja+W9tcEAkmOGHdDj4CUlvdq+RTPqNF9ZmbTHxFRSjmKoSk5KoZlppuiDEK0b818Le vOjMuE1+M4JaFX2BaRJ3O0rI+/B/CUB8W2Bzw79vtljX4Ka3ovpidApBmvMr+1rKe4K+ xb9mURrIyaJ5VnhnbtD6Q0fOG2HD9ih3J293xFovES0r1m+BVqA2OULkDYaw6rbmuVog J1GA== 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 e1-v6si3284810ple.654.2018.03.21.00.20.13; Wed, 21 Mar 2018 00:20:33 -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 S1751763AbeCUHS3 (ORCPT + 99 others); Wed, 21 Mar 2018 03:18:29 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6664 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751514AbeCUHST (ORCPT ); Wed, 21 Mar 2018 03:18:19 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 05232C588979A; Wed, 21 Mar 2018 15:18:01 +0800 (CST) Received: from linux-ioko.site (10.71.200.31) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Wed, 21 Mar 2018 15:17:54 +0800 From: Peng Li To: CC: , , , , Subject: [PATCH net-next 11/11] net: hns3: fix for not returning problem in get_link_ksettings when phy exists Date: Wed, 21 Mar 2018 15:49:30 +0800 Message-ID: <1521618570-129694-12-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521618570-129694-1-git-send-email-lipeng321@huawei.com> References: <1521618570-129694-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: Fuyun Liang 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 Signed-off-by: Peng Li --- drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c | 8 ++++++-- 1 file 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 513d8d6..9d07116 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, -- 2.9.3