aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/chelsio/cxgb2.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 689b91c77465..c3b1648618c8 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1385,26 +1385,26 @@ static inline void t1_sw_reset(struct pci_dev *pdev)
1385static void __devexit remove_one(struct pci_dev *pdev) 1385static void __devexit remove_one(struct pci_dev *pdev)
1386{ 1386{
1387 struct net_device *dev = pci_get_drvdata(pdev); 1387 struct net_device *dev = pci_get_drvdata(pdev);
1388 struct adapter *adapter = dev->priv;
1389 int i;
1388 1390
1389 if (dev) { 1391 for_each_port(adapter, i) {
1390 int i; 1392 if (test_bit(i, &adapter->registered_device_map))
1391 struct adapter *adapter = dev->priv; 1393 unregister_netdev(adapter->port[i].dev);
1392 1394 }
1393 for_each_port(adapter, i)
1394 if (test_bit(i, &adapter->registered_device_map))
1395 unregister_netdev(adapter->port[i].dev);
1396 1395
1397 t1_free_sw_modules(adapter); 1396 t1_free_sw_modules(adapter);
1398 iounmap(adapter->regs); 1397 iounmap(adapter->regs);
1399 while (--i >= 0)
1400 if (adapter->port[i].dev)
1401 free_netdev(adapter->port[i].dev);
1402 1398
1403 pci_release_regions(pdev); 1399 while (--i >= 0) {
1404 pci_disable_device(pdev); 1400 if (adapter->port[i].dev)
1405 pci_set_drvdata(pdev, NULL); 1401 free_netdev(adapter->port[i].dev);
1406 t1_sw_reset(pdev);
1407 } 1402 }
1403
1404 pci_release_regions(pdev);
1405 pci_disable_device(pdev);
1406 pci_set_drvdata(pdev, NULL);
1407 t1_sw_reset(pdev);
1408} 1408}
1409 1409
1410static struct pci_driver driver = { 1410static struct pci_driver driver = {