Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83650
b: refs/heads/master
c: 6c04a51
h: refs/heads/master
v: v3
  • Loading branch information
Leonardo Potenza authored and Jeff Garzik committed Feb 5, 2008
1 parent c4d9f15 commit da26b9d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 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: 324ff2c1793b6d3d5c377cf6de2ada9b49af227a
refs/heads/master: 6c04a515085e6b94266db3e0e05c2700eeffa469
25 changes: 18 additions & 7 deletions trunk/drivers/net/tlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,25 +465,30 @@ static struct pci_driver tlan_driver = {

static int __init tlan_probe(void)
{
static int pad_allocated;
int rc = -ENODEV;

printk(KERN_INFO "%s", tlan_banner);

TLanPadBuffer = (u8 *) pci_alloc_consistent(NULL, TLAN_MIN_FRAME_SIZE, &TLanPadBufferDMA);

if (TLanPadBuffer == NULL) {
printk(KERN_ERR "TLAN: Could not allocate memory for pad buffer.\n");
return -ENOMEM;
rc = -ENOMEM;
goto err_out;
}

memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE);
pad_allocated = 1;

TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe....\n");

/* Use new style PCI probing. Now the kernel will
do most of this for us */
pci_register_driver(&tlan_driver);
rc = pci_register_driver(&tlan_driver);

if (rc != 0) {
printk(KERN_ERR "TLAN: Could not register pci driver.\n");
goto err_out_pci_free;
}

TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe....\n");
TLan_EisaProbe();
Expand All @@ -493,11 +498,17 @@ static int __init tlan_probe(void)
tlan_have_pci, tlan_have_eisa);

if (TLanDevicesInstalled == 0) {
pci_unregister_driver(&tlan_driver);
pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA);
return -ENODEV;
rc = -ENODEV;
goto err_out_pci_unreg;
}
return 0;

err_out_pci_unreg:
pci_unregister_driver(&tlan_driver);
err_out_pci_free:
pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, TLanPadBufferDMA);
err_out:
return rc;
}


Expand Down

0 comments on commit da26b9d

Please sign in to comment.