aboutsummaryrefslogtreecommitdiff
path: root/hw/sd.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2011-12-18 21:37:56 +0100
committerAndrzej Zaborowski <andrew.zaborowski@intel.com>2011-12-21 05:01:35 +0100
commitb1f517ed4311da719d7584d1be36a4f21127b0f1 (patch)
tree3a5b61eca1c5884ee3845bea37335aaf35657465 /hw/sd.c
parent53bb8cc4855827f2981bf0566076233573a05bd7 (diff)
hw/sd.c: Handle CRC and locked-card errors in normal code path
Handle returning CRC and locked-card errors in the same code path we use for other responses. This makes no difference in behaviour but means that these error responses will be printed by the debug logging code. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Andrzej Zaborowski <andrew.zaborowski@intel.com>
Diffstat (limited to 'hw/sd.c')
-rw-r--r--hw/sd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/sd.c b/hw/sd.c
index 57925af1da..9116f67b83 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1296,7 +1296,8 @@ int sd_do_command(SDState *sd, SDRequest *req,
if (sd_req_crc_validate(req)) {
sd->card_status |= COM_CRC_ERROR;
- return 0;
+ rtype = sd_illegal;
+ goto send_response;
}
sd->card_status &= ~CARD_STATUS_B;
@@ -1306,7 +1307,8 @@ int sd_do_command(SDState *sd, SDRequest *req,
if (!cmd_valid_while_locked(sd, req)) {
sd->card_status |= ILLEGAL_COMMAND;
fprintf(stderr, "SD: Card is locked\n");
- return 0;
+ rtype = sd_illegal;
+ goto send_response;
}
}
@@ -1322,6 +1324,7 @@ int sd_do_command(SDState *sd, SDRequest *req,
sd->current_cmd = req->cmd;
+send_response:
switch (rtype) {
case sd_r1:
case sd_r1b: