[PATCH 11/14] mmc: bcm2835: refactor bcm2835_wait_transfer_complete()

Stefan Wahren stefan.wahren at i2se.com
Sat Jan 7 04:51:11 PST 2017


Signed-off-by: Stefan Wahren <stefan.wahren at i2se.com>
---
 drivers/mmc/host/bcm2835.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 01fb0c2..21beda8 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -280,17 +280,17 @@ static void bcm2835_wait_transfer_complete(struct bcm2835_host *host)
 {
 	int timediff;
 	u32 alternate_idle;
-	u32 edm;
 
 	alternate_idle = (host->mrq->data->flags & MMC_DATA_READ) ?
 		SDEDM_FSM_READWAIT : SDEDM_FSM_WRITESTART1;
 
-	edm = readl(host->ioaddr + SDEDM);
-
 	timediff = 0;
 
 	while (1) {
-		u32 fsm = edm & SDEDM_FSM_MASK;
+		u32 edm, fsm;
+
+		edm = readl(host->ioaddr + SDEDM);
+		fsm = edm & SDEDM_FSM_MASK;
 
 		if ((fsm == SDEDM_FSM_IDENTMODE) ||
 		    (fsm == SDEDM_FSM_DATAMODE))
@@ -311,7 +311,6 @@ static void bcm2835_wait_transfer_complete(struct bcm2835_host *host)
 			return;
 		}
 		cpu_relax();
-		edm = readl(host->ioaddr + SDEDM);
 	}
 }
 
-- 
1.7.9.5




More information about the linux-rpi-kernel mailing list