netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: [PATCH net-next 1/5] net: phy: use genphy_c45_aneg_done in genphy_aneg_done
Date: Sat, 2 Mar 2019 17:10:00 +0100	[thread overview]
Message-ID: <4ab446fb-ab77-8dbd-0fed-b8f0bb1ca270@gmail.com> (raw)
In-Reply-To: <7c0ef5fe-2f4f-d365-a028-d96179e9fab4@gmail.com>

Now that we have it let's use genphy_c45_aneg_done() in phy_aneg_done().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/phy.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 69dc64a4d..3745220c5 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -144,14 +144,10 @@ int phy_aneg_done(struct phy_device *phydev)
 {
 	if (phydev->drv && phydev->drv->aneg_done)
 		return phydev->drv->aneg_done(phydev);
-
-	/* Avoid genphy_aneg_done() if the Clause 45 PHY does not
-	 * implement Clause 22 registers
-	 */
-	if (phydev->is_c45 && !(phydev->c45_ids.devices_in_package & BIT(0)))
-		return -EINVAL;
-
-	return genphy_aneg_done(phydev);
+	else if (phydev->is_c45)
+		return genphy_c45_aneg_done(phydev);
+	else
+		return genphy_aneg_done(phydev);
 }
 EXPORT_SYMBOL(phy_aneg_done);
 
-- 
2.21.0



  reply	other threads:[~2019-03-02 16:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-02 16:09 [PATCH net-next 0/5] net: phy: clean up the old gen10g functions Heiner Kallweit
2019-03-02 16:10 ` Heiner Kallweit [this message]
2019-03-03 15:34   ` [PATCH net-next 1/5] net: phy: use genphy_c45_aneg_done in genphy_aneg_done Andrew Lunn
2019-03-02 16:10 ` [PATCH net-next 2/5] net: phy: remove gen10g_suspend and gen10g_resume Heiner Kallweit
2019-03-03 15:37   ` Andrew Lunn
2019-03-02 16:11 ` [PATCH net-next 3/5] net: phy: remove gen10g_config_init Heiner Kallweit
2019-03-03 15:39   ` Andrew Lunn
2019-03-02 16:13 ` [PATCH net-next 5/5] net: phy: remove gen10g_no_soft_reset Heiner Kallweit
2019-03-03 15:45   ` Andrew Lunn
2019-03-02 16:15 ` [PATCH net-next 4/5] net: phy: don't export gen10g_read_status Heiner Kallweit
2019-03-03 15:48   ` Andrew Lunn
2019-03-03 15:58   ` Andrew Lunn
2019-03-03 16:12     ` Heiner Kallweit
2019-03-04 15:26       ` Jose Abreu
2019-03-04 15:52         ` Andrew Lunn
2019-03-04  5:48 ` [PATCH net-next 0/5] net: phy: clean up the old gen10g functions David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ab446fb-ab77-8dbd-0fed-b8f0bb1ca270@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).