Skip to content

Commit

Permalink
sky2: Make sure both ports initialize correctly
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Stephen Hemminger authored and davem330 committed Sep 15, 2009
1 parent 07e3163 commit ca51927
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ca51927

Please sign in to comment.