diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2006-12-05 17:19:06 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:43 -0500 |
commit | 47cbe6f47d854410d5c296098d87cf8151517c20 (patch) | |
tree | 73a66c94aed475bcd30d0d8a2ca210aefea4e47f /drivers/net/chelsio | |
parent | d7487421b629c5ca71ce23b10461ef0c3ad2c741 (diff) |
chelsio: useless test in cxgb2::remove_one
pci_get_drvadata() is necessarily distinct from NULL if
cxgb2::init_one succeeded. cxgb2::remove_one is solely
issued through the PCI device callback.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/chelsio')
-rw-r--r-- | drivers/net/chelsio/cxgb2.c | 32 |
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) | |||
1385 | static void __devexit remove_one(struct pci_dev *pdev) | 1385 | static 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 | ||
1410 | static struct pci_driver driver = { | 1410 | static struct pci_driver driver = { |