mmc: sdhci: clean up command error handling
authorRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 26 Jan 2016 13:39:39 +0000 (13:39 +0000)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 29 Feb 2016 10:03:14 +0000 (11:03 +0100)
Avoid multiple tests while handling a command error; simplify the code.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
[ Goes with "mmc: sdhci: fix command response CRC error handling" ]
Cc: stable@vger.kernel.org # v4.5+
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/sdhci.c

index 43d87179c2704aa1e55466e320d73ce119188342..b261613224f6741d382847c6ec49a9e9bcc91092 100644 (file)
@@ -2323,13 +2323,13 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask, u32 *mask)
                return;
        }
 
-       if (intmask & SDHCI_INT_TIMEOUT)
-               host->cmd->error = -ETIMEDOUT;
-       else if (intmask & (SDHCI_INT_CRC | SDHCI_INT_END_BIT |
-                       SDHCI_INT_INDEX))
-               host->cmd->error = -EILSEQ;
+       if (intmask & (SDHCI_INT_TIMEOUT | SDHCI_INT_CRC |
+                      SDHCI_INT_END_BIT | SDHCI_INT_INDEX)) {
+               if (intmask & SDHCI_INT_TIMEOUT)
+                       host->cmd->error = -ETIMEDOUT;
+               else
+                       host->cmd->error = -EILSEQ;
 
-       if (host->cmd->error) {
                tasklet_schedule(&host->finish_tasklet);
                return;
        }