summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorNarsimhulu Musini <nmusini@cisco.com>2013-09-12 17:45:41 -0700
committerJames Bottomley <JBottomley@Parallels.com>2013-10-25 09:57:56 +0100
commit441fbd25954c30d821187203f7dc941bf7b6d792 (patch)
tree36b89979c567d0554140d29d50f6fcf7385c7894 /drivers
parent522db3c9e1a5d3e9bfbf23d9106180651338d1bd (diff)
[SCSI] fnic: host reset returns nonzero value(errno) on success
Fixed appropriate error codes that returns negative error number on failure, and 0 on success. fnic_reset() is used directly by the fc transport callback issue_fc_host_lip which requires a negative error number on failure. Signed-off-by: Narsimhulu Musini <nmusini@cisco.com> Signed-off-by: Hiral Patel <hiralpat@cisco.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/fnic/fnic_scsi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
index d014aae19134..50f3b327bd1e 100644
--- a/drivers/scsi/fnic/fnic_scsi.c
+++ b/drivers/scsi/fnic/fnic_scsi.c
@@ -2207,7 +2207,7 @@ int fnic_reset(struct Scsi_Host *shost)
{
struct fc_lport *lp;
struct fnic *fnic;
- int ret = SUCCESS;
+ int ret = 0;
lp = shost_priv(shost);
fnic = lport_priv(lp);
@@ -2219,12 +2219,11 @@ int fnic_reset(struct Scsi_Host *shost)
* Reset local port, this will clean up libFC exchanges,
* reset remote port sessions, and if link is up, begin flogi
*/
- if (lp->tt.lport_reset(lp))
- ret = FAILED;
+ ret = lp->tt.lport_reset(lp);
FNIC_SCSI_DBG(KERN_DEBUG, fnic->lport->host,
"Returning from fnic reset %s\n",
- (ret == SUCCESS) ?
+ (ret == 0) ?
"SUCCESS" : "FAILED");
return ret;
@@ -2251,7 +2250,7 @@ int fnic_host_reset(struct scsi_cmnd *sc)
* scsi-ml tries to send a TUR to every device if host reset is
* successful, so before returning to scsi, fabric should be up
*/
- ret = fnic_reset(shost);
+ ret = (fnic_reset(shost) == 0) ? SUCCESS : FAILED;
if (ret == SUCCESS) {
wait_host_tmo = jiffies + FNIC_HOST_RESET_SETTLE_TIME * HZ;
ret = FAILED;