]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drivers/scsi/ufs: reverse the ufshcd_is_device_present logic
authorVenkatraman S <svenkatr@ti.com>
Wed, 25 Apr 2012 01:03:25 +0000 (11:03 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 30 Apr 2012 05:17:15 +0000 (15:17 +1000)
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>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/scsi/ufs/ufshcd.c

index 60dd557c3f557e8bbc7127536b780d1e3af5ee60..b9f85b587a5ba2f9f44bf1010f6faf08830745ad 100644 (file)
@@ -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;