[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1292357896-14339-10-git-send-email-dm@chelsio.com>
Date: Tue, 14 Dec 2010 12:18:13 -0800
From: Dimitris Michailidis <dm@...lsio.com>
To: netdev@...r.kernel.org
Subject: [PATCH 09/12] cxgb4: remove a bitmap
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@...lsio.com>
---
drivers/net/cxgb4/cxgb4.h | 1 -
drivers/net/cxgb4/cxgb4_main.c | 3 +--
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4.h b/drivers/net/cxgb4/cxgb4.h
index 9caf95f..01d49ea 100644
--- a/drivers/net/cxgb4/cxgb4.h
+++ b/drivers/net/cxgb4/cxgb4.h
@@ -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;
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 3db21d1..d016e10 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -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)
--
1.5.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists