Skip to content
Snippets Groups Projects
Commit 73ec513a authored by Venkatraman S's avatar Venkatraman S Committed by James Bottomley
Browse files

[SCSI] ufs: reverse the ufshcd_is_device_present logic


Otherwise it counter intuitively returns 0 if device is present.

Signed-off-by: default avatarVenkatraman S <svenkatr@ti.com>
Reviewed-by: default avatarNamjae Jeon <linkinjeon@gmail.com>
Acked-by: default avatarSantosh Y <santoshsy@gmail.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 17ccafc4
No related branches found
No related tags found
No related merge requests found
...@@ -232,11 +232,11 @@ static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba) ...@@ -232,11 +232,11 @@ static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba)
* the host controller * the host controller
* @reg_hcs - host controller status register value * @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) 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) ...@@ -911,7 +911,7 @@ static int ufshcd_make_hba_operational(struct ufs_hba *hba)
/* check if device present */ /* check if device present */
reg = readl((hba->mmio_base + REG_CONTROLLER_STATUS)); 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"); dev_err(&hba->pdev->dev, "cc: Device not present\n");
err = -ENXIO; err = -ENXIO;
goto out; goto out;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment