Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 17092
b: refs/heads/master
c: decf67a
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Hemminger authored and Jeff Garzik committed Jan 9, 2006
1 parent ba11900 commit 84e427a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bce7c95e4dd4d5e924deb2929b639b4caca09c93
refs/heads/master: decf67aa2f4d498c02c2ad24a187a66c217f330c
36 changes: 21 additions & 15 deletions trunk/drivers/net/sk98lin/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -4899,15 +4899,17 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,

boards_found++;

pci_set_drvdata(pdev, dev);

/* More then one port found */
if ((pAC->GIni.GIMacsFound == 2 ) && (pAC->RlmtNets == 2)) {
if ((dev = alloc_etherdev(sizeof(DEV_NET))) == 0) {
printk(KERN_ERR "Unable to allocate etherdev "
dev = alloc_etherdev(sizeof(DEV_NET));
if (!dev) {
printk(KERN_ERR "sk98lin: unable to allocate etherdev "
"structure!\n");
goto out;
goto single_port;
}

pAC->dev[1] = dev;
pNet = netdev_priv(dev);
pNet->PortNr = 1;
pNet->NetNr = 1;
Expand Down Expand Up @@ -4939,20 +4941,25 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
if (using_dac)
dev->features |= NETIF_F_HIGHDMA;

if (register_netdev(dev)) {
printk(KERN_ERR "sk98lin: Could not register device for seconf port.\n");
error = register_netdev(dev);
if (error) {
printk(KERN_ERR "sk98lin: Could not register device"
" for second port. (%d)\n", error);
free_netdev(dev);
pAC->dev[1] = pAC->dev[0];
} else {
memcpy(&dev->dev_addr,
&pAC->Addr.Net[1].CurrentMacAddress, 6);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

printk("%s: %s\n", dev->name, DeviceStr);
printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
goto single_port;
}

pAC->dev[1] = dev;
memcpy(&dev->dev_addr,
&pAC->Addr.Net[1].CurrentMacAddress, 6);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);

printk("%s: %s\n", dev->name, DeviceStr);
printk(" PrefPort:B RlmtMode:Dual Check Link State\n");
}

single_port:

/* Save the hardware revision */
pAC->HWRevision = (((pAC->GIni.GIPciHwRev >> 4) & 0x0F)*10) +
(pAC->GIni.GIPciHwRev & 0x0F);
Expand All @@ -4964,7 +4971,6 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
memset(&pAC->PnmiBackup, 0, sizeof(SK_PNMI_STRUCT_DATA));
memcpy(&pAC->PnmiBackup, &pAC->PnmiStruct, sizeof(SK_PNMI_STRUCT_DATA));

pci_set_drvdata(pdev, dev);
return 0;

out_free_resources:
Expand Down

0 comments on commit 84e427a

Please sign in to comment.