]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
mmc: tmio: move finish_request function further down
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 19 May 2017 13:31:53 +0000 (15:31 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 20 Jun 2017 08:30:23 +0000 (10:30 +0200)
Plain code move with no changes. Needed for refactoring. Also, looks
nicer if request and finish_request are next to each other.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/tmio_mmc_core.c

index 396ce61e634a262f12558689186f72a6b3647e80..79a973273141ed71a9b0f17b756d9cbfeb262bc2 100644 (file)
@@ -315,44 +315,6 @@ static void tmio_mmc_reset_work(struct work_struct *work)
        mmc_request_done(host->mmc, mrq);
 }
 
-static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
-{
-       struct mmc_request *mrq;
-       unsigned long flags;
-
-       spin_lock_irqsave(&host->lock, flags);
-
-       mrq = host->mrq;
-       if (IS_ERR_OR_NULL(mrq)) {
-               spin_unlock_irqrestore(&host->lock, flags);
-               return;
-       }
-
-       host->cmd = NULL;
-       host->data = NULL;
-       host->force_pio = false;
-
-       cancel_delayed_work(&host->delayed_reset_work);
-
-       host->mrq = NULL;
-       spin_unlock_irqrestore(&host->lock, flags);
-
-       if (mrq->cmd->error || (mrq->data && mrq->data->error))
-               tmio_mmc_abort_dma(host);
-
-       if (host->check_scc_error)
-               host->check_scc_error(host);
-
-       mmc_request_done(host->mmc, mrq);
-}
-
-static void tmio_mmc_done_work(struct work_struct *work)
-{
-       struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
-                                                 done);
-       tmio_mmc_finish_request(host);
-}
-
 /* These are the bitmasks the tmio chip requires to implement the MMC response
  * types. Note that R1 and R6 are the same in this scheme. */
 #define APP_CMD        0x0040
@@ -945,6 +907,44 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
        tmio_process_mrq(host, mrq);
 }
 
+static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
+{
+       struct mmc_request *mrq;
+       unsigned long flags;
+
+       spin_lock_irqsave(&host->lock, flags);
+
+       mrq = host->mrq;
+       if (IS_ERR_OR_NULL(mrq)) {
+               spin_unlock_irqrestore(&host->lock, flags);
+               return;
+       }
+
+       host->cmd = NULL;
+       host->data = NULL;
+       host->force_pio = false;
+
+       cancel_delayed_work(&host->delayed_reset_work);
+
+       host->mrq = NULL;
+       spin_unlock_irqrestore(&host->lock, flags);
+
+       if (mrq->cmd->error || (mrq->data && mrq->data->error))
+               tmio_mmc_abort_dma(host);
+
+       if (host->check_scc_error)
+               host->check_scc_error(host);
+
+       mmc_request_done(host->mmc, mrq);
+}
+
+static void tmio_mmc_done_work(struct work_struct *work)
+{
+       struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
+                                                 done);
+       tmio_mmc_finish_request(host);
+}
+
 static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
 {
        if (!host->clk_enable)