diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-03-06 19:55:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-07 18:25:53 -0500 |
commit | 9fba1c31f4f3f9f860a4afee0b409cde27d06741 (patch) | |
tree | a60e05c46412926d2d23f027f3689fdd109c75af /drivers/net | |
parent | 30765d0502905a9248e5de72fc7ac83c23422861 (diff) |
cpmac: fallback to switch mode if no PHY chip found
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>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cpmac.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c index 55ee055d3321..baeb5bab05b5 100644 --- a/drivers/net/cpmac.c +++ b/drivers/net/cpmac.c | |||
@@ -1137,8 +1137,9 @@ static int __devinit cpmac_probe(struct platform_device *pdev) | |||
1137 | } | 1137 | } |
1138 | 1138 | ||
1139 | if (phy_id == PHY_MAX_ADDR) { | 1139 | if (phy_id == PHY_MAX_ADDR) { |
1140 | dev_err(&pdev->dev, "no PHY present\n"); | 1140 | dev_err(&pdev->dev, "no PHY present, falling back to switch on MDIO bus 0\n"); |
1141 | return -ENODEV; | 1141 | strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ |
1142 | phy_id = pdev->id; | ||
1142 | } | 1143 | } |
1143 | 1144 | ||
1144 | dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); | 1145 | dev = alloc_etherdev_mq(sizeof(*priv), CPMAC_QUEUES); |