Our new esdhc_poll implementation stores the register value read for
later use, so make use of it instead of reading the same register again
after the break condition has been triggered.

Signed-off-by: Ahmad Fatoum <a.fat...@pengutronix.de>
---
 drivers/mci/imx-esdhc-common.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/mci/imx-esdhc-common.c b/drivers/mci/imx-esdhc-common.c
index dae88bb977c6..a2b1ea1adfad 100644
--- a/drivers/mci/imx-esdhc-common.c
+++ b/drivers/mci/imx-esdhc-common.c
@@ -134,16 +134,14 @@ int __esdhc_send_cmd(struct fsl_esdhc_host *host, struct 
mci_cmd *cmd,
                      command << 16 | xfertyp);
 
        /* Wait for the command to complete */
-       ret = esdhc_poll(host, SDHCI_INT_STATUS, val,
-                        val & SDHCI_INT_CMD_COMPLETE,
+       ret = esdhc_poll(host, SDHCI_INT_STATUS, irqstat,
+                        irqstat & SDHCI_INT_CMD_COMPLETE,
                         100 * MSECOND);
        if (ret) {
                dev_dbg(host->dev, "timeout 1\n");
                goto undo_setup_data;
        }
 
-       irqstat = sdhci_read32(&host->sdhci, SDHCI_INT_STATUS);
-
        if (irqstat & CMD_ERR) {
                ret = -EIO;
                goto undo_setup_data;
-- 
2.39.5


Reply via email to