summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2016-07-19 16:33:36 +0900
committerJaehoon Chung <jh80.chung@samsung.com>2016-08-05 11:21:25 +0900
commit915ffa5213756568f6185d05cda2cb2f6050f974 (patch)
tree7f0d304eabe717a9c1c871cb346e6cdf18157a40 /drivers/mmc/mmc.c
parent70f862808e8ae4b97fe736ec9d9d496881ad84b2 (diff)
mmc: use the generic error number
Use the generic error number instead of specific error number. If use the generic error number, it can debug more easier. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index f8e5f7a608..3daa748822 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -152,7 +152,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
printf("Status Error: 0x%08X\n",
cmd.response[0]);
#endif
- return COMM_ERR;
+ return -ECOMM;
}
} else if (--retries < 0)
return err;
@@ -168,7 +168,7 @@ int mmc_send_status(struct mmc *mmc, int timeout)
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("Timeout waiting card ready\n");
#endif
- return TIMEOUT;
+ return -ETIMEDOUT;
}
return 0;
@@ -344,7 +344,7 @@ static int sd_send_op_cond(struct mmc *mmc)
break;
if (timeout-- <= 0)
- return UNUSABLE_ERR;
+ return -EOPNOTSUPP;
udelay(1000);
}
@@ -430,7 +430,7 @@ static int mmc_complete_op_cond(struct mmc *mmc)
if (mmc->ocr & OCR_BUSY)
break;
if (get_timer(start) > timeout)
- return UNUSABLE_ERR;
+ return -EOPNOTSUPP;
udelay(100);
}
}
@@ -1429,7 +1429,7 @@ static int mmc_startup(struct mmc *mmc)
&test_csd[EXT_CSD_SEC_CNT], 4) == 0)
break;
else
- err = SWITCH_ERR;
+ err = -EBADMSG;
}
if (err)
@@ -1499,7 +1499,7 @@ static int mmc_send_if_cond(struct mmc *mmc)
return err;
if ((cmd.response[0] & 0xff) != 0xaa)
- return UNUSABLE_ERR;
+ return -EOPNOTSUPP;
else
mmc->version = SD_VERSION_2;
@@ -1526,7 +1526,7 @@ int mmc_start_init(struct mmc *mmc)
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("MMC: no card present\n");
#endif
- return NO_CARD_ERR;
+ return -ENOMEDIUM;
}
if (mmc->has_init)
@@ -1565,14 +1565,14 @@ int mmc_start_init(struct mmc *mmc)
err = sd_send_op_cond(mmc);
/* If the command timed out, we check for an MMC card */
- if (err == TIMEOUT) {
+ if (err == -ETIMEDOUT) {
err = mmc_send_op_cond(mmc);
if (err) {
#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
printf("Card did not respond to voltage select!\n");
#endif
- return UNUSABLE_ERR;
+ return -EOPNOTSUPP;
}
}