diff options
author | Tom Rini <trini@konsulko.com> | 2016-08-05 09:15:55 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-08-05 20:55:27 -0400 |
commit | a60d94b204412732409e70cb15236bd96d4da7d9 (patch) | |
tree | 4eb4d5b6b0783a6b244625109a724185c1b64a78 /drivers/mmc/mmc_spi.c | |
parent | d03a0308599bb658598848e86aadb0d140f65e0c (diff) | |
parent | 89f69e51734f5d704ef84503d24907bfde2f5577 (diff) | |
download | u-boot-imx-a60d94b204412732409e70cb15236bd96d4da7d9.zip u-boot-imx-a60d94b204412732409e70cb15236bd96d4da7d9.tar.gz u-boot-imx-a60d94b204412732409e70cb15236bd96d4da7d9.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-mmc
Diffstat (limited to 'drivers/mmc/mmc_spi.c')
-rw-r--r-- | drivers/mmc/mmc_spi.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c index 7547e1a..2510117 100644 --- a/drivers/mmc/mmc_spi.c +++ b/drivers/mmc/mmc_spi.c @@ -5,6 +5,7 @@ * Licensed under the GPL-2 or later. */ #include <common.h> +#include <errno.h> #include <malloc.h> #include <part.h> #include <mmc.h> @@ -182,13 +183,13 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd, spi_cs_activate(spi); r1 = mmc_spi_sendcmd(mmc, cmd->cmdidx, cmd->cmdarg); if (r1 == 0xff) { /* no response */ - ret = NO_CARD_ERR; + ret = -ENOMEDIUM; goto done; } else if (r1 & R1_SPI_COM_CRC) { - ret = COMM_ERR; + ret = -ECOMM; goto done; } else if (r1 & ~R1_SPI_IDLE) { /* other errors */ - ret = TIMEOUT; + ret = -ETIMEDOUT; goto done; } else if (cmd->resp_type == MMC_RSP_R2) { r1 = mmc_spi_readdata(mmc, cmd->response, 1, 16); @@ -225,9 +226,9 @@ static int mmc_spi_request(struct mmc *mmc, struct mmc_cmd *cmd, data->blocks, data->blocksize, (cmd->cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK)); if (r1 & R1_SPI_COM_CRC) - ret = COMM_ERR; + ret = -ECOMM; else if (r1) /* other errors */ - ret = TIMEOUT; + ret = -ETIMEDOUT; } done: spi_cs_deactivate(spi); |