summaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy.c
diff options
context:
space:
mode:
authorAndreas Pretzsch <apr@cn-eng.de>2012-11-07 23:59:39 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-12 08:28:18 +0100
commit78d3b8571c2348e229f2672d6f7a044912c40214 (patch)
treeb5a8e5d9c503aabc0e6629c733963c9e8611f2fe /drivers/net/phy/phy.c
parent89dfe2d2af87f1b803f611d986d4ef383b6ad964 (diff)
downloadbarebox-78d3b8571c2348e229f2672d6f7a044912c40214.tar.gz
barebox-78d3b8571c2348e229f2672d6f7a044912c40214.tar.xz
mdiobus: unbreak phy_device_connect(): honor masked out PHYs
commit 89dfe2d2af87f1b803f611d986d4ef383b6ad964 "mdiobus: do not scan the bus at registration time" dropped the check for struct mii_bus element phy_mask while scanning through all addresses. Re-add this check. Signed-off-by: Andreas Pretzsch <apr@cn-eng.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/phy/phy.c')
-rw-r--r--drivers/net/phy/phy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 547e2690a7..d8132b9407 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -169,6 +169,10 @@ 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++) {
+ /* skip masked out PHY addresses */
+ if (bus->phy_mask & (1 << i))
+ continue;
+
dev = mdiobus_scan(bus, i);
if (!dev || dev->attached_dev)
continue;