diff options
| author | Ian Lepore <ian@FreeBSD.org> | 2017-01-08 18:28:06 +0000 |
|---|---|---|
| committer | Ian Lepore <ian@FreeBSD.org> | 2017-01-08 18:28:06 +0000 |
| commit | 90993663f88137000ff8d37b14bf8893ae02ea0f (patch) | |
| tree | fe4d215909c37369a136d0529fa14701b3f006a1 /sys/dev/sdhci | |
| parent | 012039fd559e6b100b47053c662759ad7ca0ddf0 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sdhci')
| -rw-r--r-- | sys/dev/sdhci/sdhci.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sys/dev/sdhci/sdhci.c b/sys/dev/sdhci/sdhci.c index 07828a3690cac..42fca03856beb 100644 --- a/sys/dev/sdhci/sdhci.c +++ b/sys/dev/sdhci/sdhci.c @@ -821,7 +821,7 @@ static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) { int flags, timeout; - uint32_t mask, state; + uint32_t mask; slot->curcmd = cmd; slot->cmd_done = 0; @@ -836,8 +836,6 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) return; } - /* Read controller present state. */ - state = RD4(slot, SDHCI_PRESENT_STATE); /* Do not issue command if there is no card, clock or power. * Controller will not detect timeout without clock active. */ if (!SDHCI_GET_CARD_PRESENT(slot->bus, slot) || @@ -866,7 +864,7 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) * (It's usually more like 20-30ms in the real world.) */ timeout = 250; - while (state & mask) { + while (mask & RD4(slot, SDHCI_PRESENT_STATE)) { if (timeout == 0) { slot_printf(slot, "Controller never released " "inhibit bit(s).\n"); @@ -877,7 +875,6 @@ sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd) } timeout--; DELAY(1000); - state = RD4(slot, SDHCI_PRESENT_STATE); } /* Prepare command flags. */ |
