sdhci_writew(host, mode, SDHCI_TRANSFER_MODE);
 }
 
+static bool sdhci_needs_reset(struct sdhci_host *host, struct mmc_request *mrq)
+{
+       return (!(host->flags & SDHCI_DEVICE_DEAD) &&
+               ((mrq->cmd && mrq->cmd->error) ||
+                (mrq->sbc && mrq->sbc->error) ||
+                (mrq->data && ((mrq->data->error && !mrq->data->stop) ||
+                               (mrq->data->stop && mrq->data->stop->error))) ||
+                (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST)));
+}
+
 static void sdhci_finish_mrq(struct sdhci_host *host, struct mmc_request *mrq)
 {
        tasklet_schedule(&host->finish_tasklet);
         * The controller needs a reset of internal state machines
         * upon error conditions.
         */
-       if (!(host->flags & SDHCI_DEVICE_DEAD) &&
-           ((mrq->cmd && mrq->cmd->error) ||
-            (mrq->sbc && mrq->sbc->error) ||
-            (mrq->data && ((mrq->data->error && !mrq->data->stop) ||
-                           (mrq->data->stop && mrq->data->stop->error))) ||
-            (host->quirks & SDHCI_QUIRK_RESET_AFTER_REQUEST))) {
-
+       if (sdhci_needs_reset(host, mrq)) {
                /* Some controllers need this kick or reset won't work here */
                if (host->quirks & SDHCI_QUIRK_CLOCK_BEFORE_RESET)
                        /* This is to force an update */