From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751944AbdKFCaj (ORCPT ); Sun, 5 Nov 2017 21:30:39 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10012 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751734AbdKFCaN (ORCPT ); Sun, 5 Nov 2017 21:30:13 -0500 Subject: Re: [PATCH net-next 4/6] net: hns3: add support for set_link_ksettings To: Florian Fainelli , References: <1509682710-94908-1-git-send-email-lipeng321@huawei.com> <1509682710-94908-5-git-send-email-lipeng321@huawei.com> <926ca4e8-78af-d442-38c5-bf38141051b5@gmail.com> CC: , , , From: "lipeng (Y)" Message-ID: <7f3846c6-0725-2cae-b1e6-f4519234331a@huawei.com> Date: Mon, 6 Nov 2017 10:28:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <926ca4e8-78af-d442-38c5-bf38141051b5@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.63.173.108] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090202.59FFC931.0027,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e9c88317ee2afdf070776cbdac9c0f1f Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/11/4 3:52, Florian Fainelli wrote: > On 11/02/2017 09:18 PM, Lipeng wrote: >> From: Fuyun Liang >> >> This patch adds set_link_ksettings support for ethtool cmd. >> >> Signed-off-by: Fuyun Liang >> Signed-off-by: Lipeng >> --- >> drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c | 11 +++++++++++ >> 1 file changed, 11 insertions(+) >> >> diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c >> index c7b8ebd..7fe193b 100644 >> --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c >> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hns3_ethtool.c >> @@ -653,6 +653,16 @@ static int hns3_get_link_ksettings(struct net_device *netdev, >> return 0; >> } >> >> +static int hns3_set_link_ksettings(struct net_device *netdev, >> + const struct ethtool_link_ksettings *cmd) >> +{ >> + /* Only support ksettings_set for netdev with phy attached for now */ >> + if (netdev->phydev) >> + return phy_ethtool_ksettings_set(netdev->phydev, cmd); >> + >> + return -EOPNOTSUPP; > Consider using phy_ethtool_get_link_ksettings() which already checks for > netdev->phydev. agree, Thanks for your comment. as this patch has been applied to net-next, we will push another cleanup patch.