From: Frans Meulenbroeks Date: Sat, 31 Jul 2010 04:45:18 +0000 (+0000) Subject: drivers/mmc/fsl_esdhc.c: reordered tests X-Git-Tag: v2011.06-rc1~147^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=63fb5a7e4b0ada0bf77dd89120a61d2bd14e50af;p=u-boot drivers/mmc/fsl_esdhc.c: reordered tests As DATA_ERROR includes the value IRQSTAT_DTOE, a timeout error would yield the first error return instead of TIMEOUT. By swapping the test TIMEOUTs are reported as such An alternate solution would be to remove the IRQSTAT_DTOE from the DATA_ERROR define but as that one might be less desired I've opted for the simplest solution Signed-off-by: Frans Meulenbroeks Signed-off-by: Andy Fleming --- diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 4f1b5150c9..2838795feb 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -332,11 +332,11 @@ esdhc_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, struct mmc_data *data) do { irqstat = esdhc_read32(®s->irqstat); - if (irqstat & DATA_ERR) - return COMM_ERR; - if (irqstat & IRQSTAT_DTOE) return TIMEOUT; + + if (irqstat & DATA_ERR) + return COMM_ERR; } while (!(irqstat & IRQSTAT_TC) && (esdhc_read32(®s->prsstat) & PRSSTAT_DLA)); #endif