linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: xiaolinkui <xiaolinkui@tj.kylinos.cn>
To: peppe.cavallaro@st.com
Cc: alexandre.torgue@st.com, netdev@vger.kernel.org,
	davem@davemloft.net, joabreu@synopsys.com,
	mcoquelin.stm32@gmail.com, xiaolinkui <xiaolinkui@tj.kylinos.cn>,
	linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: stmmac: Abort loop after phydev is detected
Date: Thu, 26 Mar 2020 11:23:41 +0800	[thread overview]
Message-ID: <20200326032341.30280-1-xiaolinkui@tj.kylinos.cn> (raw)

A net_device only needs at most one phydev, There is no need
to recycle the entire list after finding a phydev.

Signed-off-by: xiaolinkui <xiaolinkui@tj.kylinos.cn>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
index cfe5d8b73142..6fb87cc18d65 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
@@ -431,6 +431,9 @@ int stmmac_mdio_register(struct net_device *ndev)
 
 		phy_attached_info(phydev);
 		found = 1;
+
+		if (phydev->phy_id != 0)
+			goto bus_register_done;
 	}
 
 	if (!found && !mdio_node) {
-- 
2.17.1




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

                 reply	other threads:[~2020-03-26  3:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200326032341.30280-1-xiaolinkui@tj.kylinos.cn \
    --to=xiaolinkui@tj.kylinos.cn \
    --cc=alexandre.torgue@st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    /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).