summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2009-09-14 08:22:29 +0200
committerDavid S. Miller <davem@davemloft.net>2009-09-15 11:50:04 +0200
commitca519274d537706b6fb1e3e91238d34a23320584 (patch)
treead527f92050b1ce7e7918c9f175df1cd993d2269 /drivers/net
parentsky2: transmit ring accounting (diff)
downloadlinux-ca519274d537706b6fb1e3e91238d34a23320584.tar.xz
linux-ca519274d537706b6fb1e3e91238d34a23320584.zip
sky2: Make sure both ports initialize correctly
Sorry Mike, I sent you off the wrong way. The following is simpler and the second port is diffrent enough in setup (because of NAPI), that the following is simpler. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sky2.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index fc3803316970..4bb52e9cd371 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4550,16 +4550,18 @@ static int __devinit sky2_probe(struct pci_dev *pdev,
if (hw->ports > 1) {
struct net_device *dev1;
+ err = -ENOMEM;
dev1 = sky2_init_netdev(hw, 1, using_dac, wol_default);
- if (!dev1)
- dev_warn(&pdev->dev, "allocation for second device failed\n");
- else if ((err = register_netdev(dev1))) {
+ if (dev1 && (err = register_netdev(dev1)) == 0)
+ sky2_show_addr(dev1);
+ else {
dev_warn(&pdev->dev,
"register of second port failed (%d)\n", err);
hw->dev[1] = NULL;
- free_netdev(dev1);
- } else
- sky2_show_addr(dev1);
+ hw->ports = 1;
+ if (dev1)
+ free_netdev(dev1);
+ }
}
setup_timer(&hw->watchdog_timer, sky2_watchdog, (unsigned long) hw);