aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorLinus Walleij2017-01-24 11:17:53 +0100
committerUlf Hansson2017-02-13 13:20:38 +0100
commitefb5a05e70dfa79fe26133be9a239cbca8ea08c3 (patch)
tree8f9debfca88f56772e906a0ae8c164e6932a0098 /drivers/mmc
parent4e1f780032c56894e8d7b6685b029b718588f483 (diff)
mmc: block: break out mmc_blk_rw_start_new()
As a step toward breaking apart the very complex function mmc_blk_issue_rw_rq() we break out the code to start a new request. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/block.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index 14efe92a14ef..b60d1fb3a07a 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -1609,6 +1609,22 @@ static void mmc_blk_rw_cmd_abort(struct mmc_card *card, struct request *req)
blk_rq_cur_bytes(req));
}
+static void mmc_blk_rw_start_new(struct mmc_queue *mq, struct mmc_card *card,
+ struct request *req)
+{
+ if (!req)
+ return;
+
+ if (mmc_card_removed(card)) {
+ req->rq_flags |= RQF_QUIET;
+ blk_end_request_all(req, -EIO);
+ } else {
+ mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
+ mmc_start_req(card->host,
+ &mq->mqrq_cur->mmc_active, NULL);
+ }
+}
+
static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
{
struct mmc_blk_data *md = mq->blkdata;
@@ -1751,16 +1767,7 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
mmc_blk_rw_cmd_abort(card, req);
start_new_req:
- if (rqc) {
- if (mmc_card_removed(card)) {
- rqc->rq_flags |= RQF_QUIET;
- blk_end_request_all(rqc, -EIO);
- } else {
- mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq);
- mmc_start_req(card->host,
- &mq->mqrq_cur->mmc_active, NULL);
- }
- }
+ mmc_blk_rw_start_new(mq, card, rqc);
return 0;
}