]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 14:33:44 +0000 (07:33 -0700)
commit ec014cbacf6229c583cb832726ca39be1ae3d8c3 upstream.

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" ]
Tested-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/sdhci.c

index 2b3cc68bb83958dfdfc076a840e434eb61c20305..136255b03929e9c50385d0d95439b6461c1238d8 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;
        }