aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2005-12-14 00:09:54 -0500
committerDavid S. Miller <davem@davemloft.net>2005-12-14 00:09:54 -0500
commit16fe9d74f14ed74af778c5db7f9129e29916f4a7 (patch)
tree909a2b173d5140b22df9f35a252dc204dba56bdd
parent6a9eba15f51c56da637e45ea1316eaa2a848986a (diff)
[TG3]: Fix 5704 single-port mode
If the dual-port 5704 is configured as a single-port device with only one PCI function, it would trigger a BUG() condition in tg3_find_5704_peer(). This fixes the problem by returning its own pdev if the peer cannot be found. Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/tg3.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 6b7ab4b72752..a143c18c7bc6 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10443,8 +10443,13 @@ static struct pci_dev * __devinit tg3_find_5704_peer(struct tg3 *tp)
10443 break; 10443 break;
10444 pci_dev_put(peer); 10444 pci_dev_put(peer);
10445 } 10445 }
10446 if (!peer || peer == tp->pdev) 10446 /* 5704 can be configured in single-port mode, set peer to
10447 BUG(); 10447 * tp->pdev in that case.
10448 */
10449 if (!peer) {
10450 peer = tp->pdev;
10451 return peer;
10452 }
10448 10453
10449 /* 10454 /*
10450 * We don't need to keep the refcount elevated; there's no way 10455 * We don't need to keep the refcount elevated; there's no way