diff options
Diffstat (limited to 'drivers/net/ethernet/dec/tulip/xircom_cb.c')
| -rw-r--r-- | drivers/net/ethernet/dec/tulip/xircom_cb.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/drivers/net/ethernet/dec/tulip/xircom_cb.c b/drivers/net/ethernet/dec/tulip/xircom_cb.c index 138bf83bc98..6204cdfe43a 100644 --- a/drivers/net/ethernet/dec/tulip/xircom_cb.c +++ b/drivers/net/ethernet/dec/tulip/xircom_cb.c @@ -28,7 +28,6 @@ #include <linux/etherdevice.h> #include <linux/skbuff.h> #include <linux/delay.h> -#include <linux/init.h> #include <linux/bitops.h> #include <asm/uaccess.h> @@ -148,7 +147,7 @@ static struct pci_driver xircom_ops = { .name = "xircom_cb", .id_table = xircom_pci_table, .probe = xircom_probe, - .remove = __devexit_p(xircom_remove), + .remove = xircom_remove, }; @@ -190,7 +189,7 @@ static const struct net_device_ops netdev_ops = { first two packets that get send, and pump hates that. */ -static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id) +static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id) { struct device *d = &pdev->dev; struct net_device *dev = NULL; @@ -236,17 +235,14 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ private->rx_buffer = dma_alloc_coherent(d, 8192, &private->rx_dma_handle, GFP_KERNEL); - if (private->rx_buffer == NULL) { - pr_err("%s: no memory for rx buffer\n", __func__); + if (private->rx_buffer == NULL) goto rx_buf_fail; - } + private->tx_buffer = dma_alloc_coherent(d, 8192, &private->tx_dma_handle, GFP_KERNEL); - if (private->tx_buffer == NULL) { - pr_err("%s: no memory for tx buffer\n", __func__); + if (private->tx_buffer == NULL) goto tx_buf_fail; - } SET_NETDEV_DEV(dev, &pdev->dev); @@ -292,7 +288,6 @@ out: err_unmap: pci_iounmap(pdev, private->ioaddr); reg_fail: - pci_set_drvdata(pdev, NULL); dma_free_coherent(d, 8192, private->tx_buffer, private->tx_dma_handle); tx_buf_fail: dma_free_coherent(d, 8192, private->rx_buffer, private->rx_dma_handle); @@ -312,7 +307,7 @@ err_disable: Interrupts and such are already stopped in the "ifconfig ethX down" code. */ -static void __devexit xircom_remove(struct pci_dev *pdev) +static void xircom_remove(struct pci_dev *pdev) { struct net_device *dev = pci_get_drvdata(pdev); struct xircom_private *card = netdev_priv(dev); @@ -320,7 +315,6 @@ static void __devexit xircom_remove(struct pci_dev *pdev) unregister_netdev(dev); pci_iounmap(pdev, card->ioaddr); - pci_set_drvdata(pdev, NULL); dma_free_coherent(d, 8192, card->tx_buffer, card->tx_dma_handle); dma_free_coherent(d, 8192, card->rx_buffer, card->rx_dma_handle); free_netdev(dev); @@ -1174,16 +1168,4 @@ investigate_write_descriptor(struct net_device *dev, } } -static int __init xircom_init(void) -{ - return pci_register_driver(&xircom_ops); -} - -static void __exit xircom_exit(void) -{ - pci_unregister_driver(&xircom_ops); -} - -module_init(xircom_init) -module_exit(xircom_exit) - +module_pci_driver(xircom_ops); |
