diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2007-07-22 16:18:46 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-09-23 02:46:48 -0400 |
commit | 17b0429dde9ab60f9cee8e07ab28c7dc6cfe6efd (patch) | |
tree | 9f87df1ffbeca4c6f828b7979f2e45ef898a3ef0 /drivers/mmc/host/imxmmc.c | |
parent | b7e113dc9d52c4a37d2da6fafe77959f3a28eccf (diff) |
mmc: remove custom error codes
Convert the MMC layer to use standard error codes and not its own,
incompatible values.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/host/imxmmc.c')
-rw-r--r-- | drivers/mmc/host/imxmmc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mmc/host/imxmmc.c b/drivers/mmc/host/imxmmc.c index 54bfc9f25596..04458c342812 100644 --- a/drivers/mmc/host/imxmmc.c +++ b/drivers/mmc/host/imxmmc.c | |||
@@ -428,11 +428,11 @@ static int imxmci_finish_data(struct imxmci_host *host, unsigned int stat) | |||
428 | if ( stat & STATUS_ERR_MASK ) { | 428 | if ( stat & STATUS_ERR_MASK ) { |
429 | dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n",stat); | 429 | dev_dbg(mmc_dev(host->mmc), "request failed. status: 0x%08x\n",stat); |
430 | if(stat & (STATUS_CRC_READ_ERR | STATUS_CRC_WRITE_ERR)) | 430 | if(stat & (STATUS_CRC_READ_ERR | STATUS_CRC_WRITE_ERR)) |
431 | data->error = MMC_ERR_BADCRC; | 431 | data->error = -EILSEQ; |
432 | else if(stat & STATUS_TIME_OUT_READ) | 432 | else if(stat & STATUS_TIME_OUT_READ) |
433 | data->error = MMC_ERR_TIMEOUT; | 433 | data->error = -ETIMEDOUT; |
434 | else | 434 | else |
435 | data->error = MMC_ERR_FAILED; | 435 | data->error = -EIO; |
436 | } else { | 436 | } else { |
437 | data->bytes_xfered = host->dma_size; | 437 | data->bytes_xfered = host->dma_size; |
438 | } | 438 | } |
@@ -458,10 +458,10 @@ static int imxmci_cmd_done(struct imxmci_host *host, unsigned int stat) | |||
458 | 458 | ||
459 | if (stat & STATUS_TIME_OUT_RESP) { | 459 | if (stat & STATUS_TIME_OUT_RESP) { |
460 | dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n"); | 460 | dev_dbg(mmc_dev(host->mmc), "CMD TIMEOUT\n"); |
461 | cmd->error = MMC_ERR_TIMEOUT; | 461 | cmd->error = -ETIMEDOUT; |
462 | } else if (stat & STATUS_RESP_CRC_ERR && cmd->flags & MMC_RSP_CRC) { | 462 | } else if (stat & STATUS_RESP_CRC_ERR && cmd->flags & MMC_RSP_CRC) { |
463 | dev_dbg(mmc_dev(host->mmc), "cmd crc error\n"); | 463 | dev_dbg(mmc_dev(host->mmc), "cmd crc error\n"); |
464 | cmd->error = MMC_ERR_BADCRC; | 464 | cmd->error = -EILSEQ; |
465 | } | 465 | } |
466 | 466 | ||
467 | if(cmd->flags & MMC_RSP_PRESENT) { | 467 | if(cmd->flags & MMC_RSP_PRESENT) { |
@@ -482,7 +482,7 @@ static int imxmci_cmd_done(struct imxmci_host *host, unsigned int stat) | |||
482 | dev_dbg(mmc_dev(host->mmc), "RESP 0x%08x, 0x%08x, 0x%08x, 0x%08x, error %d\n", | 482 | dev_dbg(mmc_dev(host->mmc), "RESP 0x%08x, 0x%08x, 0x%08x, 0x%08x, error %d\n", |
483 | cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3], cmd->error); | 483 | cmd->resp[0], cmd->resp[1], cmd->resp[2], cmd->resp[3], cmd->error); |
484 | 484 | ||
485 | if (data && (cmd->error == MMC_ERR_NONE) && !(stat & STATUS_ERR_MASK)) { | 485 | if (data && !cmd->error && !(stat & STATUS_ERR_MASK)) { |
486 | if (host->req->data->flags & MMC_DATA_WRITE) { | 486 | if (host->req->data->flags & MMC_DATA_WRITE) { |
487 | 487 | ||
488 | /* Wait for FIFO to be empty before starting DMA write */ | 488 | /* Wait for FIFO to be empty before starting DMA write */ |
@@ -491,7 +491,7 @@ static int imxmci_cmd_done(struct imxmci_host *host, unsigned int stat) | |||
491 | if(imxmci_busy_wait_for_status(host, &stat, | 491 | if(imxmci_busy_wait_for_status(host, &stat, |
492 | STATUS_APPL_BUFF_FE, | 492 | STATUS_APPL_BUFF_FE, |
493 | 40, "imxmci_cmd_done DMA WR") < 0) { | 493 | 40, "imxmci_cmd_done DMA WR") < 0) { |
494 | cmd->error = MMC_ERR_FIFO; | 494 | cmd->error = -EIO; |
495 | imxmci_finish_data(host, stat); | 495 | imxmci_finish_data(host, stat); |
496 | if(host->req) | 496 | if(host->req) |
497 | imxmci_finish_request(host, host->req); | 497 | imxmci_finish_request(host, host->req); |