mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andreas Pretzsch <apr@cn-eng.de>
To: barebox@lists.infradead.org
Subject: [PATCH] mdiobus: unbreak phy_device_connect() "scan all PHY addresses" feature
Date: Wed,  7 Nov 2012 02:52:19 +0100	[thread overview]
Message-ID: <1352253139-19430-1-git-send-email-apr@cn-eng.de> (raw)

Calling phy_device_connect() with a PHY address of -1 will scan for a PHY
in the address range of 0..PHY_MAX_ADDR and registers the first one found.
This was broken by commit 09254f639c94cc7dc47fff7638dc8c7f88d700b1
"mdiobus: do not scan the bus at registration time", erroneously scanning
for -1 as PHY address.

Signed-off-by: Andreas Pretzsch <apr@cn-eng.de>
---
patch against branch "next" / commit 129300139cbe7265c4b8b4142740c59b5b997e4d

 drivers/net/phy/phy.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 8d36300..547e269 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -169,7 +169,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
 				goto fail;
 		} else {
 			for (i = 0; i < PHY_MAX_ADDR && !edev->phydev; i++) {
-				dev = mdiobus_scan(bus, addr);
+				dev = mdiobus_scan(bus, i);
 				if (!dev || dev->attached_dev)
 					continue;
 
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2012-11-07  1:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07  1:52 Andreas Pretzsch [this message]
2012-11-07  8:05 ` Sascha Hauer

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=1352253139-19430-1-git-send-email-apr@cn-eng.de \
    --to=apr@cn-eng.de \
    --cc=barebox@lists.infradead.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