From 0f0d40217f83596b93ff12cdb589931f8d9c3fa4 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 16 Apr 2012 21:47:15 +0200 Subject: mci: pxamci fix response type When preparing a command, apply a mask so that only the command part will be used for the switch case. This will be more robust for future command response types. Signed-off-by: Robert Jarzmik Signed-off-by: Sascha Hauer --- drivers/mci/pxamci.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/mci/pxamci.c b/drivers/mci/pxamci.c index 2d49187c36..f251d75f4e 100644 --- a/drivers/mci/pxamci.c +++ b/drivers/mci/pxamci.c @@ -163,18 +163,19 @@ static int pxamci_transfer_data(struct pxamci_host *host, return ret; } +#define MMC_RSP_MASK (MMC_RSP_PRESENT | MMC_RSP_136 | MMC_RSP_CRC | \ + MMC_RSP_BUSY | MMC_RSP_OPCODE) static void pxamci_start_cmd(struct pxamci_host *host, struct mci_cmd *cmd, unsigned int cmdat) { mci_dbg("cmd=(idx=%d,type=%d,clkrt=%d)\n", cmd->cmdidx, cmd->resp_type, host->clkrt); - if (cmd->resp_type & MMC_RSP_BUSY) - cmdat |= CMDAT_BUSY; - switch (cmd->resp_type) { + switch (cmd->resp_type & MMC_RSP_MASK) { /* r1, r1b, r6, r7 */ - case MMC_RSP_R1: case MMC_RSP_R1b: + cmdat |= CMDAT_BUSY; + case MMC_RSP_R1: cmdat |= CMDAT_RESP_SHORT; break; case MMC_RSP_R2: -- cgit v1.2.3