Skip to content

Commit ed97550

Browse files
Andy-ld Lustorulf
authored andcommitted
mmc: core: Introduce the MMC_RSP_R1B_NO_CRC response
The R1B response type with ignoring CRC is used in the mmc_cqe_recovery(), introduce the MMC_RSP_R1B_NO_CRC response type to simplify the code. Signed-off-by: Andy-ld Lu <[email protected]> Message-ID: <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent ea79df1 commit ed97550

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

drivers/mmc/core/core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,7 @@ int mmc_cqe_recovery(struct mmc_host *host)
557557

558558
memset(&cmd, 0, sizeof(cmd));
559559
cmd.opcode = MMC_STOP_TRANSMISSION;
560-
cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
561-
cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */
560+
cmd.flags = MMC_RSP_R1B_NO_CRC | MMC_CMD_AC; /* Ignore CRC */
562561
cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT;
563562
mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
564563

@@ -567,8 +566,7 @@ int mmc_cqe_recovery(struct mmc_host *host)
567566
memset(&cmd, 0, sizeof(cmd));
568567
cmd.opcode = MMC_CMDQ_TASK_MGMT;
569568
cmd.arg = 1; /* Discard entire queue */
570-
cmd.flags = MMC_RSP_R1B | MMC_CMD_AC;
571-
cmd.flags &= ~MMC_RSP_CRC; /* Ignore CRC */
569+
cmd.flags = MMC_RSP_R1B_NO_CRC | MMC_CMD_AC; /* Ignore CRC */
572570
cmd.busy_timeout = MMC_CQE_RECOVERY_TIMEOUT;
573571
err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES);
574572

include/linux/mmc/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct mmc_command {
5757
#define MMC_RSP_NONE (0)
5858
#define MMC_RSP_R1 (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE)
5959
#define MMC_RSP_R1B (MMC_RSP_PRESENT|MMC_RSP_CRC|MMC_RSP_OPCODE|MMC_RSP_BUSY)
60+
#define MMC_RSP_R1B_NO_CRC (MMC_RSP_PRESENT|MMC_RSP_OPCODE|MMC_RSP_BUSY)
6061
#define MMC_RSP_R2 (MMC_RSP_PRESENT|MMC_RSP_136|MMC_RSP_CRC)
6162
#define MMC_RSP_R3 (MMC_RSP_PRESENT)
6263
#define MMC_RSP_R4 (MMC_RSP_PRESENT)

0 commit comments

Comments
 (0)