summary refs log tree commit diff
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
authorLudovic Barre <ludovic.barre@st.com>2019-04-26 09:46:34 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2019-05-06 12:33:03 +0200
commit812513c7b18c7de825da3d4a7501329925b4ec1b (patch)
tree7e7441f55445405c1e0e8a06925e49bca379f7f7 /drivers/mmc/host/mmci.c
parent7a019f9b432b371156989be49db43f86aefdf5d3 (diff)
downloadlinux-812513c7b18c7de825da3d4a7501329925b4ec1b.tar.gz
mmc: mmci: Cleanup mmci_cmd_irq() for busy detect
Let's cleanup the mmci_cmd_irq() a bit, to make the busy detect code more
clear.

Signed-off-by: Ludovic Barre <ludovic.barre@st.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 9e9596a68f4c..049f8e3676ac 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1205,12 +1205,13 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
 	     unsigned int status)
 {
 	void __iomem *base = host->base;
-	bool sbc;
+	bool sbc, busy_resp;
 
 	if (!cmd)
 		return;
 
 	sbc = (cmd == host->mrq->sbc);
+	busy_resp = !!(cmd->flags & MMC_RSP_BUSY);
 
 	/*
 	 * We need to be one of these interrupts to be considered worth
@@ -1224,8 +1225,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
 	/*
 	 * ST Micro variant: handle busy detection.
 	 */
-	if (host->variant->busy_detect) {
-		bool busy_resp = !!(cmd->flags & MMC_RSP_BUSY);
+	if (busy_resp && host->variant->busy_detect) {
 
 		/* We are busy with a command, return */
 		if (host->busy_status &&
@@ -1238,7 +1238,7 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd,
 		 * that the special busy status bit is still set before
 		 * proceeding.
 		 */
-		if (!host->busy_status && busy_resp &&
+		if (!host->busy_status &&
 		    !(status & (MCI_CMDCRCFAIL|MCI_CMDTIMEOUT)) &&
 		    (readl(base + MMCISTATUS) & host->variant->busy_detect_flag)) {