aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/core/mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r--drivers/mmc/core/mmc.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 21d7f48e1d4..fe483d5af74 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -164,10 +164,10 @@ static int mmc_read_ext_csd(struct mmc_card *card)
BUG_ON(!card);
- err = MMC_ERR_FAILED;
+ err = -EIO;
if (card->csd.mmca_vsn < CSD_SPEC_VER_4)
- return MMC_ERR_NONE;
+ return 0;
/*
* As the ext_csd is so large and mostly unused, we don't store the
@@ -178,11 +178,11 @@ static int mmc_read_ext_csd(struct mmc_card *card)
printk(KERN_ERR "%s: could not allocate a buffer to "
"receive the ext_csd. mmc v4 cards will be "
"treated as v3.\n", mmc_hostname(card->host));
- return MMC_ERR_FAILED;
+ return -ENOMEM;
}
err = mmc_send_ext_csd(card, ext_csd);
- if (err != MMC_ERR_NONE) {
+ if (err) {
/*
* High capacity cards should have this "magic" size
* stored in their CSD.
@@ -197,7 +197,7 @@ static int mmc_read_ext_csd(struct mmc_card *card)
"EXT_CSD, performance might "
"suffer.\n",
mmc_hostname(card->host));
- err = MMC_ERR_NONE;
+ err = 0;
}
goto out;
}
@@ -258,14 +258,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
/* The extra bit indicates that we support high capacity */
err = mmc_send_op_cond(host, ocr | (1 << 30), NULL);
- if (err != MMC_ERR_NONE)
+ if (err)
goto err;
/*
* Fetch CID from card.
*/
err = mmc_all_send_cid(host, cid);
- if (err != MMC_ERR_NONE)
+ if (err)
goto err;
if (oldcard) {
@@ -290,7 +290,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* Set card RCA.
*/
err = mmc_set_relative_addr(card);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
mmc_set_bus_mode(host, MMC_BUSMODE_PUSHPULL);
@@ -300,7 +300,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* Fetch CSD from card.
*/
err = mmc_send_csd(card, card->raw_csd);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
err = mmc_decode_csd(card);
@@ -315,7 +315,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* Select card, as all following commands rely on that.
*/
err = mmc_select_card(card);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
if (!oldcard) {
@@ -323,7 +323,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
* Fetch and process extened CSD.
*/
err = mmc_read_ext_csd(card);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
}
@@ -334,7 +334,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
(host->caps & MMC_CAP_MMC_HIGHSPEED)) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_HS_TIMING, 1);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
mmc_card_set_highspeed(card);
@@ -363,7 +363,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
(host->caps & MMC_CAP_4_BIT_DATA)) {
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
EXT_CSD_BUS_WIDTH, EXT_CSD_BUS_WIDTH_4);
- if (err != MMC_ERR_NONE)
+ if (err)
goto free_card;
mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4);
@@ -372,14 +372,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
if (!oldcard)
host->card = card;
- return MMC_ERR_NONE;
+ return 0;
free_card:
if (!oldcard)
mmc_remove_card(card);
err:
- return MMC_ERR_FAILED;
+ return -EIO;
}
/*
@@ -413,7 +413,7 @@ static void mmc_detect(struct mmc_host *host)
mmc_release_host(host);
- if (err != MMC_ERR_NONE) {
+ if (err) {
mmc_remove(host);
mmc_claim_host(host);
@@ -502,7 +502,7 @@ static void mmc_resume(struct mmc_host *host)
err = mmc_init_card(host, host->ocr, host->card);
mmc_release_host(host);
- if (err != MMC_ERR_NONE) {
+ if (err) {
mmc_remove(host);
mmc_claim_host(host);
@@ -565,7 +565,7 @@ int mmc_attach_mmc(struct mmc_host *host, u32 ocr)
* Detect and init the card.
*/
err = mmc_init_card(host, host->ocr, NULL);
- if (err != MMC_ERR_NONE)
+ if (err)
goto err;
mmc_release_host(host);