aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 40c43bfce681..48b01fe0b9ba 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)
232 * the host controller 232 * the host controller
233 * @reg_hcs - host controller status register value 233 * @reg_hcs - host controller status register value
234 * 234 *
235 * Returns 0 if device present, non-zero if no device detected 235 * Returns 1 if device present, 0 if no device detected
236 */ 236 */
237static inline int ufshcd_is_device_present(u32 reg_hcs) 237static inline int ufshcd_is_device_present(u32 reg_hcs)
238{ 238{
239 return (DEVICE_PRESENT & reg_hcs) ? 0 : -1; 239 return (DEVICE_PRESENT & reg_hcs) ? 1 : 0;
240} 240}
241 241
242/** 242/**
@@ -911,7 +911,7 @@ static int ufshcd_make_hba_operational(struct ufs_hba *hba)
911 911
912 /* check if device present */ 912 /* check if device present */
913 reg = readl((hba->mmio_base + REG_CONTROLLER_STATUS)); 913 reg = readl((hba->mmio_base + REG_CONTROLLER_STATUS));
914 if (ufshcd_is_device_present(reg)) { 914 if (!ufshcd_is_device_present(reg)) {
915 dev_err(&hba->pdev->dev, "cc: Device not present\n"); 915 dev_err(&hba->pdev->dev, "cc: Device not present\n");
916 err = -ENXIO; 916 err = -ENXIO;
917 goto out; 917 goto out;