aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNamjae Jeon <linkinjeon@gmail.com>2012-07-10 11:11:54 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 03:59:02 -0400
commit94c122ab01f84332c371dc4ae0f5b70e879173d6 (patch)
tree1089fb91f6eab452dfbd40a13b862de0e567f474 /drivers
parent73ec513a3b1fa89d3cbaf0bc7dcc3a2b67936f2a (diff)
[SCSI] ufs: fix incorrect return value about SUCCESS and FAILED
Currently the UFS host driver has returned incorrect values for SUCCESS and FAILED. Fix it to return the correct value to the upper layer. Signed-off-by: Namjae Jeon <linkinjeon@gmail.com> Acked-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: Venkatraman S <svenkatr@ti.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/ufs/ufshcd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 48b01fe0b9ba..58f4ba6fe412 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1163,6 +1163,8 @@ static int ufshcd_task_req_compl(struct ufs_hba *hba, u32 index)
1163 if (task_result != UPIU_TASK_MANAGEMENT_FUNC_COMPL && 1163 if (task_result != UPIU_TASK_MANAGEMENT_FUNC_COMPL &&
1164 task_result != UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED) 1164 task_result != UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED)
1165 task_result = FAILED; 1165 task_result = FAILED;
1166 else
1167 task_result = SUCCESS;
1166 } else { 1168 } else {
1167 task_result = FAILED; 1169 task_result = FAILED;
1168 dev_err(&hba->pdev->dev, 1170 dev_err(&hba->pdev->dev,
@@ -1556,7 +1558,7 @@ ufshcd_issue_tm_cmd(struct ufs_hba *hba,
1556 goto out; 1558 goto out;
1557 } 1559 }
1558 clear_bit(free_slot, &hba->tm_condition); 1560 clear_bit(free_slot, &hba->tm_condition);
1559 return ufshcd_task_req_compl(hba, free_slot); 1561 err = ufshcd_task_req_compl(hba, free_slot);
1560out: 1562out:
1561 return err; 1563 return err;
1562} 1564}
@@ -1580,7 +1582,7 @@ static int ufshcd_device_reset(struct scsi_cmnd *cmd)
1580 tag = cmd->request->tag; 1582 tag = cmd->request->tag;
1581 1583
1582 err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_LOGICAL_RESET); 1584 err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_LOGICAL_RESET);
1583 if (err) 1585 if (err == FAILED)
1584 goto out; 1586 goto out;
1585 1587
1586 for (pos = 0; pos < hba->nutrs; pos++) { 1588 for (pos = 0; pos < hba->nutrs; pos++) {
@@ -1620,7 +1622,7 @@ static int ufshcd_host_reset(struct scsi_cmnd *cmd)
1620 if (hba->ufshcd_state == UFSHCD_STATE_RESET) 1622 if (hba->ufshcd_state == UFSHCD_STATE_RESET)
1621 return SUCCESS; 1623 return SUCCESS;
1622 1624
1623 return (ufshcd_do_reset(hba) == SUCCESS) ? SUCCESS : FAILED; 1625 return ufshcd_do_reset(hba);
1624} 1626}
1625 1627
1626/** 1628/**
@@ -1652,7 +1654,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
1652 spin_unlock_irqrestore(host->host_lock, flags); 1654 spin_unlock_irqrestore(host->host_lock, flags);
1653 1655
1654 err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_ABORT_TASK); 1656 err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_ABORT_TASK);
1655 if (err) 1657 if (err == FAILED)
1656 goto out; 1658 goto out;
1657 1659
1658 scsi_dma_unmap(cmd); 1660 scsi_dma_unmap(cmd);