From 1986ec804f77bd45a0285c4eb56e4fc124f37d8e Mon Sep 17 00:00:00 2001 From: Venkatraman S Date: Thu, 3 May 2012 15:43:26 +1000 Subject: [PATCH] drivers/scsi/ufs: reverse the ufshcd_is_device_present logic Otherwise it counter intuitively returns 0 if device is present. Signed-off-by: Venkatraman S Reviewed-by: Namjae Jeon Acked-by: Santosh Y Cc: James Bottomley Signed-off-by: Andrew Morton --- drivers/scsi/ufs/ufshcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 60dd557c3f55..b9f85b587a5b 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; -- 2.39.5