aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@serverengines.com>2010-07-21 18:46:38 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-07-28 10:05:29 -0400
commitd3ad2bb31c26d7314fad98da8abb04f4fa24ed16 (patch)
treecf2ccd6434cddce6e6c52df040b032384a52875a
parent457ff3b7dc3796d8778286217ad304ff122e948f (diff)
[SCSI] be2iscsi: Fixing return values
This patch fixes the return values as per comment from Mike Christie Signed-off-by: Jayamohan Kallickal <jayamohank@serverengines.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.c12
-rw-r--r--drivers/scsi/be2iscsi/be_iscsi.c12
-rw-r--r--drivers/scsi/be2iscsi/be_main.c4
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c2
4 files changed, 15 insertions, 15 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.c b/drivers/scsi/be2iscsi/be_cmds.c
index 4f19030c1e3e..9cc1f5573150 100644
--- a/drivers/scsi/be2iscsi/be_cmds.c
+++ b/drivers/scsi/be2iscsi/be_cmds.c
@@ -98,7 +98,7 @@ static int be_mcc_compl_process(struct be_ctrl_info *ctrl,
98 dev_err(&ctrl->pdev->dev, 98 dev_err(&ctrl->pdev->dev,
99 "error in cmd completion: status(compl/extd)=%d/%d\n", 99 "error in cmd completion: status(compl/extd)=%d/%d\n",
100 compl_status, extd_status); 100 compl_status, extd_status);
101 return -1; 101 return -EBUSY;
102 } 102 }
103 return 0; 103 return 0;
104} 104}
@@ -231,7 +231,7 @@ static int be_mcc_wait_compl(struct beiscsi_hba *phba)
231 } 231 }
232 if (i == mcc_timeout) { 232 if (i == mcc_timeout) {
233 dev_err(&phba->pcidev->dev, "mccq poll timed out\n"); 233 dev_err(&phba->pcidev->dev, "mccq poll timed out\n");
234 return -1; 234 return -EBUSY;
235 } 235 }
236 return 0; 236 return 0;
237} 237}
@@ -257,7 +257,7 @@ static int be_mbox_db_ready_wait(struct be_ctrl_info *ctrl)
257 257
258 if (cnt > 6000000) { 258 if (cnt > 6000000) {
259 dev_err(&ctrl->pdev->dev, "mbox_db poll timed out\n"); 259 dev_err(&ctrl->pdev->dev, "mbox_db poll timed out\n");
260 return -1; 260 return -EBUSY;
261 } 261 }
262 262
263 if (cnt > 50) { 263 if (cnt > 50) {
@@ -309,7 +309,7 @@ int be_mbox_notify(struct be_ctrl_info *ctrl)
309 } 309 }
310 } else { 310 } else {
311 dev_err(&ctrl->pdev->dev, "invalid mailbox completion\n"); 311 dev_err(&ctrl->pdev->dev, "invalid mailbox completion\n");
312 return -1; 312 return -EBUSY;
313 } 313 }
314 return 0; 314 return 0;
315} 315}
@@ -355,7 +355,7 @@ static int be_mbox_notify_wait(struct beiscsi_hba *phba)
355 return status; 355 return status;
356 } else { 356 } else {
357 dev_err(&phba->pcidev->dev, "invalid mailbox completion\n"); 357 dev_err(&phba->pcidev->dev, "invalid mailbox completion\n");
358 return -1; 358 return -EBUSY;
359 } 359 }
360 return 0; 360 return 0;
361} 361}
@@ -652,7 +652,7 @@ int beiscsi_cmd_q_destroy(struct be_ctrl_info *ctrl, struct be_queue_info *q,
652 default: 652 default:
653 spin_unlock(&ctrl->mbox_lock); 653 spin_unlock(&ctrl->mbox_lock);
654 BUG(); 654 BUG();
655 return -1; 655 return -ENXIO;
656 } 656 }
657 be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req)); 657 be_cmd_hdr_prepare(&req->hdr, subsys, opcode, sizeof(*req));
658 if (queue_type != QTYPE_SGL) 658 if (queue_type != QTYPE_SGL)
diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index d9321ee01534..cd1b8301036d 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -230,7 +230,7 @@ int beiscsi_conn_get_param(struct iscsi_cls_conn *cls_conn,
230 if (!beiscsi_ep) { 230 if (!beiscsi_ep) {
231 SE_DEBUG(DBG_LVL_1, 231 SE_DEBUG(DBG_LVL_1,
232 "In beiscsi_conn_get_param , no beiscsi_ep\n"); 232 "In beiscsi_conn_get_param , no beiscsi_ep\n");
233 return -1; 233 return -ENODEV;
234 } 234 }
235 235
236 switch (param) { 236 switch (param) {
@@ -309,7 +309,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
309 tag = be_cmd_get_mac_addr(phba); 309 tag = be_cmd_get_mac_addr(phba);
310 if (!tag) { 310 if (!tag) {
311 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n"); 311 SE_DEBUG(DBG_LVL_1, "be_cmd_get_mac_addr Failed\n");
312 return -1; 312 return -EAGAIN;
313 } else 313 } else
314 wait_event_interruptible(phba->ctrl.mcc_wait[tag], 314 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
315 phba->ctrl.mcc_numtag[tag]); 315 phba->ctrl.mcc_numtag[tag]);
@@ -322,7 +322,7 @@ int beiscsi_get_host_param(struct Scsi_Host *shost,
322 " status = %d extd_status = %d\n", 322 " status = %d extd_status = %d\n",
323 status, extd_status); 323 status, extd_status);
324 free_mcc_tag(&phba->ctrl, tag); 324 free_mcc_tag(&phba->ctrl, tag);
325 return -1; 325 return -EAGAIN;
326 } else { 326 } else {
327 wrb = queue_get_wrb(mccq, wrb_num); 327 wrb = queue_get_wrb(mccq, wrb_num);
328 free_mcc_tag(&phba->ctrl, tag); 328 free_mcc_tag(&phba->ctrl, tag);
@@ -485,7 +485,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
485 struct tcp_connect_and_offload_out *ptcpcnct_out; 485 struct tcp_connect_and_offload_out *ptcpcnct_out;
486 unsigned short status, extd_status; 486 unsigned short status, extd_status;
487 unsigned int tag, wrb_num; 487 unsigned int tag, wrb_num;
488 int ret = -1; 488 int ret = -ENOMEM;
489 489
490 SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn\n"); 490 SE_DEBUG(DBG_LVL_8, "In beiscsi_open_conn\n");
491 beiscsi_ep->ep_cid = beiscsi_get_cid(phba); 491 beiscsi_ep->ep_cid = beiscsi_get_cid(phba);
@@ -536,7 +536,7 @@ static int beiscsi_open_conn(struct iscsi_endpoint *ep,
536 536
537free_ep: 537free_ep:
538 beiscsi_free_ep(beiscsi_ep); 538 beiscsi_free_ep(beiscsi_ep);
539 return -1; 539 return -EBUSY;
540} 540}
541 541
542/** 542/**
@@ -626,7 +626,7 @@ static int beiscsi_close_conn(struct beiscsi_endpoint *beiscsi_ep, int flag)
626 if (!tag) { 626 if (!tag) {
627 SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x\n", 627 SE_DEBUG(DBG_LVL_8, "upload failed for cid 0x%x\n",
628 beiscsi_ep->ep_cid); 628 beiscsi_ep->ep_cid);
629 ret = -1; 629 ret = -EAGAIN;
630 } else { 630 } else {
631 wait_event_interruptible(phba->ctrl.mcc_wait[tag], 631 wait_event_interruptible(phba->ctrl.mcc_wait[tag],
632 phba->ctrl.mcc_numtag[tag]); 632 phba->ctrl.mcc_numtag[tag]);
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index 001888b0c842..e6259d7498f3 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -2681,7 +2681,7 @@ static int be_queue_alloc(struct beiscsi_hba *phba, struct be_queue_info *q,
2681 mem->size = len * entry_size; 2681 mem->size = len * entry_size;
2682 mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma); 2682 mem->va = pci_alloc_consistent(phba->pcidev, mem->size, &mem->dma);
2683 if (!mem->va) 2683 if (!mem->va)
2684 return -1; 2684 return -ENOMEM;
2685 memset(mem->va, 0, mem->size); 2685 memset(mem->va, 0, mem->size);
2686 return 0; 2686 return 0;
2687} 2687}
@@ -2877,7 +2877,7 @@ mcc_cq_destroy:
2877mcc_cq_free: 2877mcc_cq_free:
2878 be_queue_free(phba, cq); 2878 be_queue_free(phba, cq);
2879err: 2879err:
2880 return -1; 2880 return -ENOMEM;
2881} 2881}
2882 2882
2883static int find_num_cpus(void) 2883static int find_num_cpus(void)
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 7d4ac5c1a868..ff8b1cd6fec4 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -81,7 +81,7 @@ unsigned char mgmt_check_supported_fw(struct be_ctrl_info *ctrl,
81 SE_DEBUG(DBG_LVL_1, 81 SE_DEBUG(DBG_LVL_1,
82 "Failed to allocate memory for mgmt_check_supported_fw" 82 "Failed to allocate memory for mgmt_check_supported_fw"
83 "\n"); 83 "\n");
84 return -1; 84 return -ENOMEM;
85 } 85 }
86 nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes); 86 nonemb_cmd.size = sizeof(struct be_mgmt_controller_attributes);
87 req = nonemb_cmd.va; 87 req = nonemb_cmd.va;