Commit a1b4a029 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[NET]: Move Red Creek VPN drier to alloc_etherdev().

parent a9e4c8a9
...@@ -171,13 +171,14 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -171,13 +171,14 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
* will be assigned to the LAN API layer. * will be assigned to the LAN API layer.
*/ */
dev = init_etherdev (NULL, sizeof (*pDpa)); dev = alloc_etherdev(sizeof(*pDpa));
if (!dev) { if (!dev) {
printk (KERN_ERR printk (KERN_ERR
"(rcpci45 driver:) init_etherdev alloc failed\n"); "(rcpci45 driver:) alloc_etherdev alloc failed\n");
error = -ENOMEM; error = -ENOMEM;
goto err_out; goto err_out;
} }
SET_MODULE_OWNER(dev); SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev); SET_NETDEV_DEV(dev, &pdev->dev);
...@@ -257,6 +258,9 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -257,6 +258,9 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
dev->do_ioctl = &RCioctl; dev->do_ioctl = &RCioctl;
dev->set_config = &RCconfig; dev->set_config = &RCconfig;
if ((error = register_netdev(dev)))
goto err_out_free_region;
return 0; /* success */ return 0; /* success */
err_out_free_region: err_out_free_region:
...@@ -265,7 +269,6 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -265,7 +269,6 @@ rcpci45_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf, pci_free_consistent (pdev, MSG_BUF_SIZE, pDpa->msgbuf,
pDpa->msgbuf_dma); pDpa->msgbuf_dma);
err_out_free_dev: err_out_free_dev:
unregister_netdev (dev);
kfree (dev); kfree (dev);
err_out: err_out:
card_idx--; card_idx--;
...@@ -717,11 +720,9 @@ rc_timer (unsigned long data) ...@@ -717,11 +720,9 @@ rc_timer (unsigned long data)
if (retry > REBOOT_REINIT_RETRY_LIMIT) { if (retry > REBOOT_REINIT_RETRY_LIMIT) {
printk (KERN_WARNING "%s unable to reinitialize adapter after reboot\n", dev->name); printk (KERN_WARNING "%s unable to reinitialize adapter after reboot\n", dev->name);
printk (KERN_WARNING "%s decrementing driver and closing interface\n", dev->name); printk (KERN_WARNING "%s shutting down interface\n", dev->name);
RCDisableI2OInterrupts (dev); RCDisableI2OInterrupts (dev);
dev->flags &= ~IFF_UP; dev->flags &= ~IFF_UP;
MOD_DEC_USE_COUNT;
/* FIXME: kill MOD_DEC_USE_COUNT, use dev_put */
} else { } else {
printk (KERN_INFO "%s: rescheduling timer...\n", printk (KERN_INFO "%s: rescheduling timer...\n",
dev->name); dev->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment