diff options
| author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2011-06-20 15:10:08 -0400 |
|---|---|---|
| committer | Chris Ball <cjb@laptop.org> | 2011-07-20 17:20:54 -0400 |
| commit | 0a2d4048a22079d7e79d6654bbacbef57bd5728a (patch) | |
| tree | 3de4e928e43786b215271d467e77cf6e20a2e724 /include/linux/mmc | |
| parent | 6e83e10d92e12fa0181766a1fbb00d857bfab779 (diff) | |
mmc: block: allow get_card_status() to return error status
If the MMC_SEND_STATUS command is not successful, we should not return
a zero status word, but instead allow the caller to know positively
that an error occurred.
Convert the open-coded get_card_status() to use the helper function,
and provide definitions for the card state field.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Tested-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
| -rw-r--r-- | include/linux/mmc/mmc.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 5bade0605641..5a794cb503ea 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
| @@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode) | |||
| 140 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ | 140 | #define R1_SWITCH_ERROR (1 << 7) /* sx, c */ |
| 141 | #define R1_APP_CMD (1 << 5) /* sr, c */ | 141 | #define R1_APP_CMD (1 << 5) /* sr, c */ |
| 142 | 142 | ||
| 143 | #define R1_STATE_IDLE 0 | ||
| 144 | #define R1_STATE_READY 1 | ||
| 145 | #define R1_STATE_IDENT 2 | ||
| 146 | #define R1_STATE_STBY 3 | ||
| 147 | #define R1_STATE_TRAN 4 | ||
| 148 | #define R1_STATE_DATA 5 | ||
| 149 | #define R1_STATE_RCV 6 | ||
| 150 | #define R1_STATE_PRG 7 | ||
| 151 | #define R1_STATE_DIS 8 | ||
| 152 | |||
| 143 | /* | 153 | /* |
| 144 | * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS | 154 | * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS |
| 145 | * R1 is the low order byte; R2 is the next highest byte, when present. | 155 | * R1 is the low order byte; R2 is the next highest byte, when present. |
