Skip to content

Commit f5fdcd1

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: tmio: move finish_request function further down
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 <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent c592742 commit f5fdcd1

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

drivers/mmc/host/tmio_mmc_core.c

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -315,44 +315,6 @@ static void tmio_mmc_reset_work(struct work_struct *work)
315315
mmc_request_done(host->mmc, mrq);
316316
}
317317

318-
static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
319-
{
320-
struct mmc_request *mrq;
321-
unsigned long flags;
322-
323-
spin_lock_irqsave(&host->lock, flags);
324-
325-
mrq = host->mrq;
326-
if (IS_ERR_OR_NULL(mrq)) {
327-
spin_unlock_irqrestore(&host->lock, flags);
328-
return;
329-
}
330-
331-
host->cmd = NULL;
332-
host->data = NULL;
333-
host->force_pio = false;
334-
335-
cancel_delayed_work(&host->delayed_reset_work);
336-
337-
host->mrq = NULL;
338-
spin_unlock_irqrestore(&host->lock, flags);
339-
340-
if (mrq->cmd->error || (mrq->data && mrq->data->error))
341-
tmio_mmc_abort_dma(host);
342-
343-
if (host->check_scc_error)
344-
host->check_scc_error(host);
345-
346-
mmc_request_done(host->mmc, mrq);
347-
}
348-
349-
static void tmio_mmc_done_work(struct work_struct *work)
350-
{
351-
struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
352-
done);
353-
tmio_mmc_finish_request(host);
354-
}
355-
356318
/* These are the bitmasks the tmio chip requires to implement the MMC response
357319
* types. Note that R1 and R6 are the same in this scheme. */
358320
#define APP_CMD 0x0040
@@ -945,6 +907,44 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
945907
tmio_process_mrq(host, mrq);
946908
}
947909

910+
static void tmio_mmc_finish_request(struct tmio_mmc_host *host)
911+
{
912+
struct mmc_request *mrq;
913+
unsigned long flags;
914+
915+
spin_lock_irqsave(&host->lock, flags);
916+
917+
mrq = host->mrq;
918+
if (IS_ERR_OR_NULL(mrq)) {
919+
spin_unlock_irqrestore(&host->lock, flags);
920+
return;
921+
}
922+
923+
host->cmd = NULL;
924+
host->data = NULL;
925+
host->force_pio = false;
926+
927+
cancel_delayed_work(&host->delayed_reset_work);
928+
929+
host->mrq = NULL;
930+
spin_unlock_irqrestore(&host->lock, flags);
931+
932+
if (mrq->cmd->error || (mrq->data && mrq->data->error))
933+
tmio_mmc_abort_dma(host);
934+
935+
if (host->check_scc_error)
936+
host->check_scc_error(host);
937+
938+
mmc_request_done(host->mmc, mrq);
939+
}
940+
941+
static void tmio_mmc_done_work(struct work_struct *work)
942+
{
943+
struct tmio_mmc_host *host = container_of(work, struct tmio_mmc_host,
944+
done);
945+
tmio_mmc_finish_request(host);
946+
}
947+
948948
static int tmio_mmc_clk_enable(struct tmio_mmc_host *host)
949949
{
950950
if (!host->clk_enable)

0 commit comments

Comments
 (0)