From: Russell King Date: Tue, 26 Jan 2016 13:39:39 +0000 (+0000) Subject: mmc: sdhci: clean up command error handling X-Git-Tag: v4.5.1~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2ee2ed103d48f32303360c9f8e975916151abbb;p=thirdparty%2Fkernel%2Fstable.git mmc: sdhci: clean up command error handling commit ec014cbacf6229c583cb832726ca39be1ae3d8c3 upstream. Avoid multiple tests while handling a command error; simplify the code. Signed-off-by: Russell King Signed-off-by: Adrian Hunter [ Goes with "mmc: sdhci: fix command response CRC error handling" ] Tested-by: Gregory CLEMENT Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2b3cc68bb8395..136255b03929e 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -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; }