From e736554ff0d3cf5655ddd66824c4866d93b0bb60 Mon Sep 17 00:00:00 2001 From: none Date: Wed, 11 Dec 2019 09:11:34 +0100 Subject: [PATCH] report MCI error codes --- ddbridge/ddbridge-mci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ddbridge/ddbridge-mci.c b/ddbridge/ddbridge-mci.c index 90d8c6f..9180592 100644 --- a/ddbridge/ddbridge-mci.c +++ b/ddbridge/ddbridge-mci.c @@ -120,12 +120,19 @@ int ddb_mci_cmd(struct mci *state, struct mci_result *result) { int stat; - + struct mci_result res; + + if (!result) + result = &res; mutex_lock(&state->base->mci_lock); stat = ddb_mci_cmd_raw_unlocked(state, (u32 *)command, sizeof(*command)/sizeof(u32), (u32 *)result, sizeof(*result)/sizeof(u32)); mutex_unlock(&state->base->mci_lock); + if (command && result && (result->status & 0x80)) + dev_warn(state->base->link->dev->dev, + "mci_command 0x%02x, error=0x%02x\n", + command->command, result->status); return stat; }