Skip to content

Commit

Permalink
cpmac: fallback to switch mode if no PHY chip found
Browse files Browse the repository at this point in the history
If we were unable to detect a PHY on any of the MDIO bus id we tried instead of
bailing out with -ENODEV, assume the MAC is connected to a switch and use MDIO
bus 0. This unbreaks quite a lot of devices out there whose switch cannot be
detected.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Mar 7, 2010
1 parent 30765d0 commit 9fba1c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/cpmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,8 +1137,9 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
}

if (phy_id == PHY_MAX_ADDR) {
dev_err(&pdev->dev, "no PHY present\n");
return -ENODEV;
dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n");
strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */
phy_id = pdev->id;
}

dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES);
Expand Down

0 comments on commit 9fba1c3

Please sign in to comment.