NetXen: Driver unload fixes
authorAmit S. Kale <amitkale@netxen.com>
Wed, 21 Feb 2007 14:37:06 +0000 (06:37 -0800)
committerJeff Garzik <jeff@garzik.org>
Tue, 27 Feb 2007 09:16:04 +0000 (04:16 -0500)
Signed-off-by: Amit S. Kale <amitkale@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/netxen/netxen_nic_hw.c
drivers/net/netxen/netxen_nic_main.c

index 7195af3e8f3ddb1182d5b81d1debe33adc44be1c..deec796f90dac984c65640e02c91d071926b964b 100644 (file)
@@ -242,10 +242,11 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
        adapter->cmd_consumer = (uint32_t *) (((char *)addr) +
                                              sizeof(struct netxen_ring_ctx));
 
-       addr = pci_alloc_consistent(adapter->ahw.pdev,
-                                   sizeof(struct cmd_desc_type0) *
-                                   adapter->max_tx_desc_count,
-                                   (dma_addr_t *) & hw->cmd_desc_phys_addr);
+       addr = netxen_alloc(adapter->ahw.pdev,
+                           sizeof(struct cmd_desc_type0) *
+                           adapter->max_tx_desc_count,
+                           (dma_addr_t *) & hw->cmd_desc_phys_addr,
+                           &adapter->ahw.cmd_desc_pdev);
        printk("cmd_desc_phys_addr: 0x%llx\n", (u64) hw->cmd_desc_phys_addr);
 
        if (addr == NULL) {
index 225ff55527c447f1e0955eac185cec895e951548..b2fc2bccc396d04290af01ca444943d0662bc47c 100644 (file)
@@ -1155,8 +1155,8 @@ static void __exit netxen_exit_module(void)
        /*
         * Wait for some time to allow the dma to drain, if any.
         */
-       destroy_workqueue(netxen_workq);
        pci_unregister_driver(&netxen_driver);
+       destroy_workqueue(netxen_workq);
 }
 
 module_exit(netxen_exit_module);