diff options
author | Anil Veerabhadrappa <anilgv@broadcom.com> | 2009-06-23 16:56:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-08-22 18:51:51 -0400 |
commit | 1ed0f6a3ef94996341f3c5a2d4034ba1a2532b0a (patch) | |
tree | daca8efab012cb926576a801fbdff9d259436ed4 /drivers/scsi/bnx2i | |
parent | 002b1eb2c03ccec36bf6e7b719cccedf57d83402 (diff) |
[SCSI] bnx2i: remove global variable bnx2i_reg_devices
Removed bnx2i_reg_devices as this counter is not really
used in a meaningful way
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Anil Veerabhadrappa <anilgv@broadcom.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bnx2i')
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index ae4b2d588fd3..269192d74372 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -15,7 +15,6 @@ | |||
15 | 15 | ||
16 | static struct list_head adapter_list = LIST_HEAD_INIT(adapter_list); | 16 | static struct list_head adapter_list = LIST_HEAD_INIT(adapter_list); |
17 | static u32 adapter_count; | 17 | static u32 adapter_count; |
18 | static int bnx2i_reg_device; | ||
19 | 18 | ||
20 | #define DRV_MODULE_NAME "bnx2i" | 19 | #define DRV_MODULE_NAME "bnx2i" |
21 | #define DRV_MODULE_VERSION "2.0.1d" | 20 | #define DRV_MODULE_VERSION "2.0.1d" |
@@ -193,10 +192,6 @@ void bnx2i_register_device(struct bnx2i_hba *hba) | |||
193 | 192 | ||
194 | hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba); | 193 | hba->cnic->register_device(hba->cnic, CNIC_ULP_ISCSI, hba); |
195 | 194 | ||
196 | spin_lock(&hba->lock); | ||
197 | bnx2i_reg_device++; | ||
198 | spin_unlock(&hba->lock); | ||
199 | |||
200 | set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | 195 | set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); |
201 | } | 196 | } |
202 | 197 | ||
@@ -234,10 +229,6 @@ static void bnx2i_unreg_one_device(struct bnx2i_hba *hba) | |||
234 | 229 | ||
235 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); | 230 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); |
236 | 231 | ||
237 | spin_lock(&hba->lock); | ||
238 | bnx2i_reg_device--; | ||
239 | spin_unlock(&hba->lock); | ||
240 | |||
241 | /* ep_disconnect could come before NETDEV_DOWN, driver won't | 232 | /* ep_disconnect could come before NETDEV_DOWN, driver won't |
242 | * see NETDEV_DOWN as it already unregistered itself. | 233 | * see NETDEV_DOWN as it already unregistered itself. |
243 | */ | 234 | */ |
@@ -276,16 +267,12 @@ static int bnx2i_init_one(struct bnx2i_hba *hba, struct cnic_dev *cnic) | |||
276 | int rc; | 267 | int rc; |
277 | 268 | ||
278 | read_lock(&bnx2i_dev_lock); | 269 | read_lock(&bnx2i_dev_lock); |
279 | if (bnx2i_reg_device && | 270 | if (!test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { |
280 | !test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { | ||
281 | rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba); | 271 | rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba); |
282 | if (rc) /* duplicate registration */ | 272 | if (rc) /* duplicate registration */ |
283 | printk(KERN_ERR "bnx2i- dev reg failed\n"); | 273 | printk(KERN_ERR "bnx2i- dev reg failed\n"); |
284 | 274 | ||
285 | spin_lock(&hba->lock); | ||
286 | bnx2i_reg_device++; | ||
287 | hba->age++; | 275 | hba->age++; |
288 | spin_unlock(&hba->lock); | ||
289 | 276 | ||
290 | set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | 277 | set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); |
291 | } | 278 | } |
@@ -350,10 +337,6 @@ void bnx2i_ulp_exit(struct cnic_dev *dev) | |||
350 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { | 337 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { |
351 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); | 338 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); |
352 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | 339 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); |
353 | |||
354 | spin_lock(&hba->lock); | ||
355 | bnx2i_reg_device--; | ||
356 | spin_unlock(&hba->lock); | ||
357 | } | 340 | } |
358 | write_unlock(&bnx2i_dev_lock); | 341 | write_unlock(&bnx2i_dev_lock); |
359 | 342 | ||
@@ -421,7 +404,6 @@ static void __exit bnx2i_mod_exit(void) | |||
421 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { | 404 | if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { |
422 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); | 405 | hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); |
423 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); | 406 | clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); |
424 | bnx2i_reg_device--; | ||
425 | } | 407 | } |
426 | 408 | ||
427 | write_unlock(&bnx2i_dev_lock); | 409 | write_unlock(&bnx2i_dev_lock); |