static void __devexit c2_remove(struct pci_dev *pcidev) { struct c2_dev *c2dev = pci_get_drvdata(pcidev); struct net_device *netdev = c2dev->netdev; c2_unregister_device(c2dev); c2_rnic_term(c2dev); unregister_netdev(netdev); free_netdev(netdev); free_irq(pcidev->irq, c2dev); iounmap(c2dev->kva); iounmap(c2dev->regs); iounmap(c2dev->mmio_txp_ring); iounmap(c2dev->mmio_rxp_ring); ib_dealloc_device(&c2dev->ibdev); pci_release_regions(pcidev); pci_disable_device(pcidev); pci_set_drvdata(pcidev, NULL); }
static void __devexit c2_remove(struct pci_dev *pcidev) { struct c2_dev *c2dev = pci_get_drvdata(pcidev); struct net_device *netdev = c2dev->netdev; /* Unregister with OpenIB */ c2_unregister_device(c2dev); /* Clean up the RNIC resources */ c2_rnic_term(c2dev); /* Remove network device from the kernel */ unregister_netdev(netdev); /* Free network device */ free_netdev(netdev); /* Free the interrupt line */ free_irq(pcidev->irq, c2dev); /* missing: Turn LEDs off here */ /* Unmap adapter PA space */ iounmap(c2dev->kva); iounmap(c2dev->regs); iounmap(c2dev->mmio_txp_ring); iounmap(c2dev->mmio_rxp_ring); /* Free the hardware structure */ ib_dealloc_device(&c2dev->ibdev); /* Release reserved PCI I/O and memory resources */ pci_release_regions(pcidev); /* Disable PCI device */ pci_disable_device(pcidev); /* Clear driver specific data */ pci_set_drvdata(pcidev, NULL); }