summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorVenkatraman S <svenkatr@ti.com>2012-07-10 19:39:23 +0530
committerJames Bottomley <JBottomley@Parallels.com>2012-07-20 08:59:01 +0100
commit73ec513a3b1fa89d3cbaf0bc7dcc3a2b67936f2a (patch)
tree441c8b196c27034c10995ed96c093159309aa4be /drivers/scsi
parent17ccafc4ef00716d022cac9ff64cef0aafe7c02a (diff)
downloadop-kernel-dev-73ec513a3b1fa89d3cbaf0bc7dcc3a2b67936f2a.zip
op-kernel-dev-73ec513a3b1fa89d3cbaf0bc7dcc3a2b67936f2a.tar.gz
[SCSI] ufs: reverse the ufshcd_is_device_present logic
Otherwise it counter intuitively returns 0 if device is present. Signed-off-by: Venkatraman S <svenkatr@ti.com> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Acked-by: Santosh Y <santoshsy@gmail.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ufs/ufshcd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 40c43bf..48b01fe 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -232,11 +232,11 @@ static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba)
* the host controller
* @reg_hcs - host controller status register value
*
- * Returns 0 if device present, non-zero if no device detected
+ * Returns 1 if device present, 0 if no device detected
*/
static inline int ufshcd_is_device_present(u32 reg_hcs)
{
- return (DEVICE_PRESENT & reg_hcs) ? 0 : -1;
+ return (DEVICE_PRESENT & reg_hcs) ? 1 : 0;
}
/**
@@ -911,7 +911,7 @@ static int ufshcd_make_hba_operational(struct ufs_hba *hba)
/* check if device present */
reg = readl((hba->mmio_base + REG_CONTROLLER_STATUS));
- if (ufshcd_is_device_present(reg)) {
+ if (!ufshcd_is_device_present(reg)) {
dev_err(&hba->pdev->dev, "cc: Device not present\n");
err = -ENXIO;
goto out;
OpenPOWER on IntegriCloud