From patchwork Thu Aug 15 12:02:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 11095707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F3A93112C for ; Thu, 15 Aug 2019 12:04:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC93D28628 for ; Thu, 15 Aug 2019 12:04:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0C95288D3; Thu, 15 Aug 2019 12:04:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3680C28628 for ; Thu, 15 Aug 2019 12:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TlXRbMGYG9Yfqyh9IKFVEXHeIk0PVeyV2jqi1ou386w=; b=ZiIMhlUdwB6QwW /iPbEu38M1/SN4lbxpKBwZGsfX0G0xuz+Zk0g0b1rFDYlgRi4AYm0xj8lx+0E5DD719YQYOe6jUQ2 mOzwnXkdPwfUA55hqOYh1y8Er9n2DP2eVPFe27IMHXKTGeUF8zaCsjZuecTg+ZGSdpbdvOQI1GsfT 7TW76jr6rWTrJVkU4AFBZNuD0zL/cJgyRUSi/Z3pm3cF6AM9sFocS7W8y496GTlceTzISQ9QYaJCd xAm7AZb0pub7fKMjiKJR1hvEgK4OIeWSPU+GjduD6Gd6E5Ay5Y2wzshTnJDJsIlabRmocGvZhbRnt 5GrrFlyRTKijeeriktew==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUW-00022b-RA; Thu, 15 Aug 2019 12:04:28 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUU-00022G-Cj for linux-amlogic@lists.infradead.org; Thu, 15 Aug 2019 12:04:27 +0000 Received: by mail-wr1-x443.google.com with SMTP id z11so2020769wrt.4 for ; Thu, 15 Aug 2019 05:04:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Z3AbuU/yp1qNl6Z3PzPMDiLEqJ6GJJk3UoAQz7E2Wrg=; b=gG6/nva07qzYWka24nM9F3plDQEL9bujs100mXTiOBiJ8NASU7oh9HqkFcCFX4BTrE gCQ8kwQFJeFsz/eAYBIa+AniiAMCkyGoT1ye+Eso5bwor0VQQ9M5tYtxL7XLpe1mFyJE 9uuSvOQjm50lmE/nSvElEcI+j5M7EFxVqNY1tX9A48NtGFUh7IOCaFvGVNxtUfJcCcqG 1bCDJQUQj2qSzfMkLXeO6CYYyYFatXtANr3o1IryfAzf1EGQBZaTCdWp4b030BJFHIst tbzDo7J8YCzVGux6wWBeciekUEhD+XO37j/e7878Ai/Alh+n3TEX0Y1c5a6pAD7w+akq LL/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Z3AbuU/yp1qNl6Z3PzPMDiLEqJ6GJJk3UoAQz7E2Wrg=; b=m9a1pwF9DEmkZadDP4kEVV+6sGNPhHjxdZj7HTrW62MPrebA0f/OelqUc3zlizUuCJ XvLZtTOTW6/U5InmVBMXtxBm3xmSSBou53Ev0SOZyoCN5VuN8nRuSc+T2SDkriQ2kW50 NmUqxKqY4oAcJLDTbT87MWUyv8VS73YSqYBDk/RsEBN6uVdVx5WLGizzF5ayIoNF8lGE bsWNhO6VK+jt7Me6dJpasoBFG/vt7QsuJdHfO8Wx66xTtCsNWanETF7Kq1tlmbca+3cj 6x83i5qa2mV6vSCnOaE9hdzDsuuzxXu0mqS3qZSpFiBt7SSJRAzlIUWCy9iJJgrFcVAU zKVg== X-Gm-Message-State: APjAAAVgwMzdoysLpzS3EwpAm0J0CyESpIR2ffetKMxKW30znh+4prRu suV6ohv9H/apqtZHIRbZz/LhW5Pd X-Google-Smtp-Source: APXvYqxUbpOhhzaPoGuh6dmghit0vx+ZPk5ipOuT12JXezvKlobs1o3WerUFTY3DO/LdmvO4yn25Jw== X-Received: by 2002:adf:db01:: with SMTP id s1mr5324679wri.164.1565870663245; Thu, 15 Aug 2019 05:04:23 -0700 (PDT) Received: from ?IPv6:2003:ea:8f2f:3200:b8fa:18d8:f880:513c? (p200300EA8F2F3200B8FA18D8F880513C.dip0.t-ipconnect.de. [2003:ea:8f2f:3200:b8fa:18d8:f880:513c]) by smtp.googlemail.com with ESMTPSA id x24sm1096197wmh.5.2019.08.15.05.04.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2019 05:04:22 -0700 (PDT) Subject: [PATCH net-next 1/3] net: phy: remove calls to genphy_config_init From: Heiner Kallweit To: Andrew Lunn , Florian Fainelli , David Miller , Kevin Hilman , Vivien Didelot References: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Message-ID: Date: Thu, 15 Aug 2019 14:02:42 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190815_050426_436674_4172D596 X-CRM114-Status: GOOD ( 16.80 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "netdev@vger.kernel.org" , "open list:ARM/Amlogic Meson..." Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Supported PHY features are either auto-detected or explicitly set. In both cases calling genphy_config_init isn't needed. All that genphy_config_init does is removing features that are set as supported but can't be auto-detected. Basically it duplicates the code in genphy_read_abilities. Therefore remove such calls from all PHY drivers. Signed-off-by: Heiner Kallweit --- drivers/net/phy/at803x.c | 4 ---- drivers/net/phy/dp83822.c | 5 ----- drivers/net/phy/dp83848.c | 16 ++++++++-------- drivers/net/phy/dp83tc811.c | 4 ---- drivers/net/phy/meson-gxl.c | 2 +- drivers/net/phy/microchip.c | 1 - drivers/net/phy/microchip_t1.c | 1 - drivers/net/phy/mscc.c | 4 ++-- drivers/net/phy/vitesse.c | 6 +++--- 9 files changed, 14 insertions(+), 29 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 6ad8b1c63..2aa7b2e60 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -249,10 +249,6 @@ static int at803x_config_init(struct phy_device *phydev) { int ret; - ret = genphy_config_init(phydev); - if (ret < 0) - return ret; - /* The RX and TX delay default is: * after HW reset: RX delay enabled and TX delay disabled * after SW reset: RX delay enabled, while TX delay retains the diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index 7ed4760fb..8a4b1d167 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -254,13 +254,8 @@ static int dp83822_config_intr(struct phy_device *phydev) static int dp83822_config_init(struct phy_device *phydev) { - int err; int value; - err = genphy_config_init(phydev); - if (err < 0) - return err; - value = DP83822_WOL_MAGIC_EN | DP83822_WOL_SECURE_ON | DP83822_WOL_EN; return phy_write_mmd(phydev, DP83822_DEVADDR, MII_DP83822_WOL_CFG, diff --git a/drivers/net/phy/dp83848.c b/drivers/net/phy/dp83848.c index 6f9bc7d91..11644579a 100644 --- a/drivers/net/phy/dp83848.c +++ b/drivers/net/phy/dp83848.c @@ -68,13 +68,8 @@ static int dp83848_config_intr(struct phy_device *phydev) static int dp83848_config_init(struct phy_device *phydev) { - int err; int val; - err = genphy_config_init(phydev); - if (err < 0) - return err; - /* DP83620 always reports Auto Negotiation Ability on BMSR. Instead, * we check initial value of BMCR Auto negotiation enable bit */ @@ -85,6 +80,11 @@ static int dp83848_config_init(struct phy_device *phydev) return 0; } +static int dummy_config_init(struct phy_device *phydev) +{ + return 0; +} + static struct mdio_device_id __maybe_unused dp83848_tbl[] = { { TI_DP83848C_PHY_ID, 0xfffffff0 }, { NS_DP83848C_PHY_ID, 0xfffffff0 }, @@ -113,13 +113,13 @@ MODULE_DEVICE_TABLE(mdio, dp83848_tbl); static struct phy_driver dp83848_driver[] = { DP83848_PHY_DRIVER(TI_DP83848C_PHY_ID, "TI DP83848C 10/100 Mbps PHY", - genphy_config_init), + dummy_config_init), DP83848_PHY_DRIVER(NS_DP83848C_PHY_ID, "NS DP83848C 10/100 Mbps PHY", - genphy_config_init), + dummy_config_init), DP83848_PHY_DRIVER(TI_DP83620_PHY_ID, "TI DP83620 10/100 Mbps PHY", dp83848_config_init), DP83848_PHY_DRIVER(TLK10X_PHY_ID, "TI TLK10X 10/100 Mbps PHY", - genphy_config_init), + dummy_config_init), }; module_phy_driver(dp83848_driver); diff --git a/drivers/net/phy/dp83tc811.c b/drivers/net/phy/dp83tc811.c index ac27da168..06f08832e 100644 --- a/drivers/net/phy/dp83tc811.c +++ b/drivers/net/phy/dp83tc811.c @@ -277,10 +277,6 @@ static int dp83811_config_init(struct phy_device *phydev) { int value, err; - err = genphy_config_init(phydev); - if (err < 0) - return err; - value = phy_read(phydev, MII_DP83811_SGMII_CTRL); if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { err = phy_write(phydev, MII_DP83811_SGMII_CTRL, diff --git a/drivers/net/phy/meson-gxl.c b/drivers/net/phy/meson-gxl.c index fa80d6dce..e8f2ca625 100644 --- a/drivers/net/phy/meson-gxl.c +++ b/drivers/net/phy/meson-gxl.c @@ -136,7 +136,7 @@ static int meson_gxl_config_init(struct phy_device *phydev) if (ret) return ret; - return genphy_config_init(phydev); + return 0; } /* This function is provided to cope with the possible failures of this phy diff --git a/drivers/net/phy/microchip.c b/drivers/net/phy/microchip.c index eb1b3287f..a644e8e50 100644 --- a/drivers/net/phy/microchip.c +++ b/drivers/net/phy/microchip.c @@ -305,7 +305,6 @@ static int lan88xx_config_init(struct phy_device *phydev) { int val; - genphy_config_init(phydev); /*Zerodetect delay enable */ val = phy_read_mmd(phydev, MDIO_MMD_PCS, PHY_ARDENNES_MMD_DEV_3_PHY_CFG); diff --git a/drivers/net/phy/microchip_t1.c b/drivers/net/phy/microchip_t1.c index 3d09b4716..001def450 100644 --- a/drivers/net/phy/microchip_t1.c +++ b/drivers/net/phy/microchip_t1.c @@ -48,7 +48,6 @@ static struct phy_driver microchip_t1_phy_driver[] = { .features = PHY_BASIC_T1_FEATURES, - .config_init = genphy_config_init, .config_aneg = genphy_config_aneg, .ack_interrupt = lan87xx_phy_ack_interrupt, diff --git a/drivers/net/phy/mscc.c b/drivers/net/phy/mscc.c index 645d354ff..7ada1fd9c 100644 --- a/drivers/net/phy/mscc.c +++ b/drivers/net/phy/mscc.c @@ -1725,7 +1725,7 @@ static int vsc8584_config_init(struct phy_device *phydev) return ret; } - return genphy_config_init(phydev); + return 0; err: mutex_unlock(&phydev->mdio.bus->mdio_lock); @@ -1767,7 +1767,7 @@ static int vsc85xx_config_init(struct phy_device *phydev) return rc; } - return genphy_config_init(phydev); + return 0; } static int vsc8584_did_interrupt(struct phy_device *phydev) diff --git a/drivers/net/phy/vitesse.c b/drivers/net/phy/vitesse.c index 43691b1ac..bb6803527 100644 --- a/drivers/net/phy/vitesse.c +++ b/drivers/net/phy/vitesse.c @@ -197,7 +197,7 @@ static int vsc738x_config_init(struct phy_device *phydev) vsc73xx_config_init(phydev); - return genphy_config_init(phydev); + return 0; } static int vsc739x_config_init(struct phy_device *phydev) @@ -229,7 +229,7 @@ static int vsc739x_config_init(struct phy_device *phydev) vsc73xx_config_init(phydev); - return genphy_config_init(phydev); + return 0; } static int vsc73xx_config_aneg(struct phy_device *phydev) @@ -267,7 +267,7 @@ static int vsc8601_config_init(struct phy_device *phydev) if (ret < 0) return ret; - return genphy_config_init(phydev); + return 0; } static int vsc824x_ack_interrupt(struct phy_device *phydev) From patchwork Thu Aug 15 12:03:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 11095709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 92E98112C for ; Thu, 15 Aug 2019 12:04:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8121422A6F for ; Thu, 15 Aug 2019 12:04:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 757B0288D7; Thu, 15 Aug 2019 12:04:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2E4AF288D2 for ; Thu, 15 Aug 2019 12:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Asn2NUOU2R8jHgLhx/NBfAi9C33n+gi3q9AhtzXuIX4=; b=o/6DnFAlhMwrT+ 65e4ikoA4IMRlHu9QxJKin7cvaUpWzk8lxgsVQmHQQ8X5fiDnRm+HDLdD+Od4blZ4Ihlo1KFLERLv 48HCrfH4jkzUxnIYygNHsga8K5OaHa3AC25tb18cRnnmiBNNKuVghwSbq0OeF3bHRFuHRy7gizAOe KwhpAKmSUxKabm40CeQZjfnrAoWprR+Xkk+OnhvOcvqfJ4w95tgyQGAVLBjHm0Sf5JAvPlGIF66sh E5u4Eh4H/jAPEq/hKAe4aDZt3tSBHuMjdgRpEB7oj9TUm5mfZtvtbPe6ggC+XDn4SlrL9hxaRY2u8 55C+0YYUIZ7mB93PccNg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUZ-00025C-Sd; Thu, 15 Aug 2019 12:04:31 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUX-00022H-3O for linux-amlogic@lists.infradead.org; Thu, 15 Aug 2019 12:04:30 +0000 Received: by mail-wm1-x329.google.com with SMTP id v19so1057408wmj.5 for ; Thu, 15 Aug 2019 05:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=upg+bZO2tl76NuL5qRGzzUNcHidJHyMzxJdBLW1vxSA=; b=Lk1QYm3XO1TtrYnK82C1/2XHM6FgvEjRLBDA78xV8inQss+x3UpnkON9d1b0nrwZPD EvmnribxuwZyieoATcD5QzkZ9Ei8oat9lstQPRD8tBF+LTL0d0BZxUHJSJ1RJemQ5VNG vLhv9lGnP1UWtvUst2PLOUzBMFXGElWnIWqmA1TFkaHWdOEw9mrJRl+06JJ518+3nQRl 9tJ9iIf2M637YJppuwb6YJuNdaOE4yQZ2RVz5jLOaTAahS2hBnM6+3pJQAH9flr0rKDk 7np4leR9J5gPkGmCXj+dtSYOH+Toms002zCHqLI424gi1wSGY+cj74DWa16DP/+FcK79 rtBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=upg+bZO2tl76NuL5qRGzzUNcHidJHyMzxJdBLW1vxSA=; b=nn+TTlLZp94AnKaKehzpeG5WdgTpEPgne8cBnLY1dwbqa9Hhuu3xhMcS2Cuud6msD/ yNAL/yLTq9iPrZZsPAP6QvV17fytRziTbTOrVdFIJ84p/S/PFqkF2Iu1+1s3xKRpy+8q jy4VmTeCb+KpVLNd7Mws+Q3KXivyq1AwZsNtNPjGSjDW4qDm8pMV5bGBq/w7iFah8bFZ 7tIHvs9OuotBRu6gWzwOkieAblzJMixCsnD1LLOYNj0toOmIUjVzfX5C2+TENTkUTNkv yXMZ1gPEuKgMmHx4ROHW+xoQ+KZOx7DJpNVKeWEvXkR7TeZZ41koB+73Gt10hJA09LKY Ex0A== X-Gm-Message-State: APjAAAWdfSR05cpVL+fK6jsfH9zuabFGJAmns1VLm7OVvIA6XnmeLmKb MaoeT/gokCtbtl9AwPdryHDXQOjc X-Google-Smtp-Source: APXvYqxDY3rncrRpFh7C8203dLkXoB1cu1beyAIHcrcOVnulG2BXBLacpK+xewCQya0hkBQnJeKQcQ== X-Received: by 2002:a7b:c929:: with SMTP id h9mr2609218wml.1.1565870664648; Thu, 15 Aug 2019 05:04:24 -0700 (PDT) Received: from ?IPv6:2003:ea:8f2f:3200:b8fa:18d8:f880:513c? (p200300EA8F2F3200B8FA18D8F880513C.dip0.t-ipconnect.de. [2003:ea:8f2f:3200:b8fa:18d8:f880:513c]) by smtp.googlemail.com with ESMTPSA id v23sm1645106wmj.32.2019.08.15.05.04.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2019 05:04:24 -0700 (PDT) Subject: [PATCH net-next 2/3] net: dsa: remove calls to genphy_config_init From: Heiner Kallweit To: Andrew Lunn , Florian Fainelli , David Miller , Kevin Hilman , Vivien Didelot References: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Message-ID: <8c34396e-fa3d-bf1f-8792-4056df64fc0f@gmail.com> Date: Thu, 15 Aug 2019 14:03:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190815_050429_147367_89CB38D0 X-CRM114-Status: GOOD ( 11.13 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "netdev@vger.kernel.org" , "open list:ARM/Amlogic Meson..." Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Supported PHY features are either auto-detected or explicitly set. In both cases calling genphy_config_init isn't needed. Signed-off-by: Heiner Kallweit --- net/dsa/port.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/net/dsa/port.c b/net/dsa/port.c index f071acf28..f75301456 100644 --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -538,10 +538,6 @@ static int dsa_port_setup_phy_of(struct dsa_port *dp, bool enable) return PTR_ERR(phydev); if (enable) { - err = genphy_config_init(phydev); - if (err < 0) - goto err_put_dev; - err = genphy_resume(phydev); if (err < 0) goto err_put_dev; @@ -589,7 +585,6 @@ static int dsa_port_fixed_link_register_of(struct dsa_port *dp) mode = PHY_INTERFACE_MODE_NA; phydev->interface = mode; - genphy_config_init(phydev); genphy_read_status(phydev); if (ds->ops->adjust_link) From patchwork Thu Aug 15 12:04:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 11095711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A2B71395 for ; Thu, 15 Aug 2019 12:04:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36DC422A6F for ; Thu, 15 Aug 2019 12:04:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B988288A0; Thu, 15 Aug 2019 12:04:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C12AC28595 for ; Thu, 15 Aug 2019 12:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ln3D5zqFY2flyVIqF0vmqAox0wrJet6l15GsxTQ17sw=; b=agWk2TkiicvMvW Ti4JwoyAgAc6yFv8POL69ySHc+yO7tLoateoljz5dEW2JTn32SqC7Z1ScrZg5MIttyp6ObLKwaY9K yZntjH88Jcpf/iz8DnMVYSsOEnE+hJC3s8WYTvpY7+bl8LS+yEwlhTpPlUgPZRooR5LDQs8lvBWUt +um2LeCFe43XxGeM8RkXUUMt+mZFIeEcUlZcyKDOFUUgxv/4DIyUluSkO0c5nNL86QsZQwHQFaXkH tjJKHfTMSw8aIHZv6kHkyQb/Rs9Q3EusqqtRxkT+SDL/0oeSey0GgqAS96nLj6dWxwxRcihoww1dC GI+PO3us3reGC4qFSX2Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUb-00026X-Ao; Thu, 15 Aug 2019 12:04:33 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hyEUX-00022V-Ia for linux-amlogic@lists.infradead.org; Thu, 15 Aug 2019 12:04:31 +0000 Received: by mail-wr1-x436.google.com with SMTP id u16so2037966wrr.0 for ; Thu, 15 Aug 2019 05:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cv9AHUXZSTIXwb3zYOsS0REKv7j9Ec1lDg+1ePlQxpg=; b=ZAw+gRewbIXMvSKpzDkDBQkRe5bSx8jpM3yr5bh1gf9cMqZ+R6+z3acFcNcdJYTRqv mMwMOK9cVTrFCLT3fJAQe4wKu1WoTNZSpDmKlp6HLoTnovFL8Ah0LwSBOfLrusGCPGpE /fYKXUf5oAMTC1ttqOSCJP9fg5lQUL35x+nPF/2OD1LMXsg5HSlfReJV5Y8wynhfS4ay rPJ+xRj8L9UkgsgqhNK36qijyhdymtFHybxIexAxqmGoGwtGBzNnhG/b9ytZwU674l8F 3QG/SzauClWbJ407RMhpLbVUV46Xx1S47dZw2LNGZX+jMGaDkppUj6j+yVcqdZNkABtf WiLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=cv9AHUXZSTIXwb3zYOsS0REKv7j9Ec1lDg+1ePlQxpg=; b=JXDc4UlGJkqKfivm9XvBYHJTbSpoZowAPRwomu9Z9Q0C8ywTP6dlOte8ckZYqeoAI4 UiTOGZEFhuINXO9Vvt1Pd3WjTfFr7eF4V0Jvbr/RidEJswLSSPXDG2G9diB0noDJBgBl /J/PQJln/jZvrYCbajuMFnFTVWO/BJlEx9U0S5QB4ntqbLbJKtm3Lu71pokkDi7cnKEq x1+N4A9LogMwbPrROszBDGvO+P/bVJEq/YDq1GJCyIy8dOp2G4PRewMgoIFozJSjDyoS IyR7vsfGdHyCU5vi+gctLDtsCBlHT6uaYjGosyrSAfnWGJkFABpNeGVpmwh1KqiOoyFT Htdg== X-Gm-Message-State: APjAAAUjV5E9zVGYbZNBH2ictpxh8iVwO3BSD0HONe+Apqy4XLSqoE34 yVIctu+1wm0i49StTDu0YWSbQQ2P X-Google-Smtp-Source: APXvYqxSYV3uua4v60rpIk/MRfYu8bHWpMRlYwl3v4EAYZ1YQ4A295aHbnQ5Pk946m/c3BaPRl+ewA== X-Received: by 2002:adf:f0ce:: with SMTP id x14mr5151799wro.31.1565870666080; Thu, 15 Aug 2019 05:04:26 -0700 (PDT) Received: from ?IPv6:2003:ea:8f2f:3200:b8fa:18d8:f880:513c? (p200300EA8F2F3200B8FA18D8F880513C.dip0.t-ipconnect.de. [2003:ea:8f2f:3200:b8fa:18d8:f880:513c]) by smtp.googlemail.com with ESMTPSA id t63sm1137065wmt.6.2019.08.15.05.04.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Aug 2019 05:04:25 -0700 (PDT) Subject: [PATCH net-next 3/3] net: phy: remove genphy_config_init From: Heiner Kallweit To: Andrew Lunn , Florian Fainelli , David Miller , Kevin Hilman , Vivien Didelot References: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Message-ID: Date: Thu, 15 Aug 2019 14:04:06 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <95dfdb55-415c-c995-cba3-1902bdd46aec@gmail.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190815_050429_640988_5981DC95 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "netdev@vger.kernel.org" , "open list:ARM/Amlogic Meson..." Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Now that all users have been removed we can remove genphy_config_init. Signed-off-by: Heiner Kallweit --- drivers/net/phy/phy_device.c | 51 ------------------------------------ include/linux/phy.h | 1 - 2 files changed, 52 deletions(-) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 7e7393f3c..d347ddcac 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1895,57 +1895,6 @@ int genphy_soft_reset(struct phy_device *phydev) } EXPORT_SYMBOL(genphy_soft_reset); -int genphy_config_init(struct phy_device *phydev) -{ - int val; - __ETHTOOL_DECLARE_LINK_MODE_MASK(features) = { 0, }; - - linkmode_set_bit_array(phy_basic_ports_array, - ARRAY_SIZE(phy_basic_ports_array), - features); - linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, features); - linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, features); - - /* Do we support autonegotiation? */ - val = phy_read(phydev, MII_BMSR); - if (val < 0) - return val; - - if (val & BMSR_ANEGCAPABLE) - linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, features); - - if (val & BMSR_100FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, features); - if (val & BMSR_100HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, features); - if (val & BMSR_10FULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, features); - if (val & BMSR_10HALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, features); - - if (val & BMSR_ESTATEN) { - val = phy_read(phydev, MII_ESTATUS); - if (val < 0) - return val; - - if (val & ESTATUS_1000_TFULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, - features); - if (val & ESTATUS_1000_THALF) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, - features); - if (val & ESTATUS_1000_XFULL) - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, - features); - } - - linkmode_and(phydev->supported, phydev->supported, features); - linkmode_and(phydev->advertising, phydev->advertising, features); - - return 0; -} -EXPORT_SYMBOL(genphy_config_init); - /** * genphy_read_abilities - read PHY abilities from Clause 22 registers * @phydev: target phy_device struct diff --git a/include/linux/phy.h b/include/linux/phy.h index 5ac7d2137..d26779f1f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -1069,7 +1069,6 @@ void phy_attached_print(struct phy_device *phydev, const char *fmt, ...) void phy_attached_info(struct phy_device *phydev); /* Clause 22 PHY */ -int genphy_config_init(struct phy_device *phydev); int genphy_read_abilities(struct phy_device *phydev); int genphy_setup_forced(struct phy_device *phydev); int genphy_restart_aneg(struct phy_device *phydev);