Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 160993
b: refs/heads/master
c: 4e85f15
h: refs/heads/master
i:
  160991: 291081f
v: v3
  • Loading branch information
Anil Veerabhadrappa authored and James Bottomley committed Aug 22, 2009
1 parent a02beb4 commit 203d962
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ed0f6a3ef94996341f3c5a2d4034ba1a2532b0a
refs/heads/master: 4e85f15166a6a9da8317ddb8600b604b27e58aa3
31 changes: 19 additions & 12 deletions trunk/drivers/scsi/bnx2i/bnx2i_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,22 +267,29 @@ static int bnx2i_init_one(struct bnx2i_hba *hba, struct cnic_dev *cnic)
int rc;

read_lock(&bnx2i_dev_lock);
if (!test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) {
rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba);
if (rc) /* duplicate registration */
printk(KERN_ERR "bnx2i- dev reg failed\n");

rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba);
if (!rc) {
hba->age++;

set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic);
}
} else if (rc == -EBUSY) /* duplicate registration */
printk(KERN_ALERT "bnx2i, duplicate registration"
"hba=%p, cnic=%p\n", hba, cnic);
else if (rc == -EAGAIN)
printk(KERN_ERR "bnx2i, driver not registered\n");
else if (rc == -EINVAL)
printk(KERN_ERR "bnx2i, invalid type %d\n", CNIC_ULP_ISCSI);
else
printk(KERN_ERR "bnx2i dev reg, unknown error, %d\n", rc);
read_unlock(&bnx2i_dev_lock);

write_lock(&bnx2i_dev_lock);
list_add_tail(&hba->link, &adapter_list);
adapter_count++;
write_unlock(&bnx2i_dev_lock);
return 0;
if (!rc) {
write_lock(&bnx2i_dev_lock);
list_add_tail(&hba->link, &adapter_list);
adapter_count++;
write_unlock(&bnx2i_dev_lock);
}

return rc;
}


Expand Down

0 comments on commit 203d962

Please sign in to comment.