cxgb4: remove a bitmap
authorDimitris Michailidis <dm@chelsio.com>
Tue, 14 Dec 2010 21:36:52 +0000 (21:36 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 16 Dec 2010 21:16:03 +0000 (13:16 -0800)
The driver keeps a bitmap of the netdevs it registered so it knows what to
unregister later.  Remove that and look at reg_state instead.

Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/cxgb4/cxgb4.h
drivers/net/cxgb4/cxgb4_main.c

index 9caf95f086e0c7731fa46e9820db4ad700b617aa..01d49eaa44d278fe2d7f0d5189ace1c9a96f63d6 100644 (file)
@@ -482,7 +482,6 @@ struct adapter {
        void __iomem *regs;
        struct pci_dev *pdev;
        struct device *pdev_dev;
-       unsigned long registered_device_map;
        unsigned int fn;
        unsigned int flags;
 
index 4d7565cf74eed4602ffa0b9ad87be6bb5fb882b8..059c1eec8c3ff79b23d7ea8e9a17c111c8c57429 100644 (file)
@@ -3725,7 +3725,6 @@ static int __devinit init_one(struct pci_dev *pdev,
                err = register_netdev(adapter->port[i]);
                if (err)
                        break;
-               __set_bit(i, &adapter->registered_device_map);
                adapter->chan_map[pi->tx_chan] = i;
                print_port_info(adapter->port[i]);
        }
@@ -3785,7 +3784,7 @@ static void __devexit remove_one(struct pci_dev *pdev)
                        detach_ulds(adapter);
 
                for_each_port(adapter, i)
-                       if (test_bit(i, &adapter->registered_device_map))
+                       if (adapter->port[i]->reg_state == NETREG_REGISTERED)
                                unregister_netdev(adapter->port[i]);
 
                if (adapter->debugfs_root)