mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
mmc: Print send_cmd response only when return value is zero
send_cmd response is valid only when no error happened. If an error occured, let mmc_send_cmd() print the return value to aid debugging. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
53e8e40b47
commit
7863ce5891
1 changed files with 42 additions and 38 deletions
|
@ -61,6 +61,9 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
|
||||||
printf("CMD_SEND:%d\n", cmd->cmdidx);
|
printf("CMD_SEND:%d\n", cmd->cmdidx);
|
||||||
printf("\t\tARG\t\t\t 0x%08X\n", cmd->cmdarg);
|
printf("\t\tARG\t\t\t 0x%08X\n", cmd->cmdarg);
|
||||||
ret = mmc->cfg->ops->send_cmd(mmc, cmd, data);
|
ret = mmc->cfg->ops->send_cmd(mmc, cmd, data);
|
||||||
|
if (ret) {
|
||||||
|
printf("\t\tRET\t\t\t %d\n", ret);
|
||||||
|
} else {
|
||||||
switch (cmd->resp_type) {
|
switch (cmd->resp_type) {
|
||||||
case MMC_RSP_NONE:
|
case MMC_RSP_NONE:
|
||||||
printf("\t\tMMC_RSP_NONE\n");
|
printf("\t\tMMC_RSP_NONE\n");
|
||||||
|
@ -102,6 +105,7 @@ int mmc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data)
|
||||||
printf("\t\tERROR MMC rsp not supported\n");
|
printf("\t\tERROR MMC rsp not supported\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
ret = mmc->cfg->ops->send_cmd(mmc, cmd, data);
|
ret = mmc->cfg->ops->send_cmd(mmc, cmd, data);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue