From patchwork Tue Jan 24 10:17:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 92321 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp1624289obz; Tue, 24 Jan 2017 02:18:16 -0800 (PST) X-Received: by 10.84.164.231 with SMTP id l36mr50793328plg.33.1485253096594; Tue, 24 Jan 2017 02:18:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m1si7259622pfb.261.2017.01.24.02.18.16; Tue, 24 Jan 2017 02:18:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750931AbdAXKSP (ORCPT + 5 others); Tue, 24 Jan 2017 05:18:15 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:32843 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750843AbdAXKSO (ORCPT ); Tue, 24 Jan 2017 05:18:14 -0500 Received: by mail-lf0-f47.google.com with SMTP id x1so21438760lff.0 for ; Tue, 24 Jan 2017 02:18:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gMw2d3WlT4rETEPf9o1ShAwGeEdYqxfb2joEfYkc2uk=; b=hqUAVOlU1jwNT9W1Y2XgEtqaIGCi/S4WH9Ox60bA1mJ404nZ7efmF9b5xKJ4Ap+cmm UYiRTKO5eq2kxGJyAw1bLF8q0Lqsif45oQp/M1N2qkHboAHNOnAAyL/lY8o7xDeqKsrI q+m/RT6x6USAHKmwIKmSito7Oe+5r+yJ5DVwU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gMw2d3WlT4rETEPf9o1ShAwGeEdYqxfb2joEfYkc2uk=; b=CNNPH4tqLs6iLdvPi4O62Hyf3CHfzomMI3vnaICwaQ/PKL2aD9zMMc/nqE03UZDJO5 mHD5J4VgymEK3ysrvGDgRS1/Os/z5dXX1aP/g1xqMapsmsSPtCZjxrz3nEsy9STIZFSL ReR2nOjvLCEtyPgzzHGT+1NSGHYftjyyLElRx2vE4j/rU60hZcRKVTBQzx3QVT1Ujvut s+pxvB2STl6XrUUafJgbsWSWVvX88qgrtaMEbQMeuEDAtUmy/VwQov58pEXPdnXMZ0P+ aAyTpQ4XUQEaoUGWKOQN3xX3nnhLlLrWzRhed0ZqHGORmmrqQPRrKCYtTp/u9xmuaOB5 z2Lg== X-Gm-Message-State: AIkVDXJDnfDNh3lUQ6sJ3Ic8bqlApDPz6edwS4NzOWoVAACIj60PJBAPfOY/qGIFVzVYJsE3 X-Received: by 10.25.72.209 with SMTP id v200mr11225224lfa.74.1485253092842; Tue, 24 Jan 2017 02:18:12 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id o91sm7410797lfg.17.2017.01.24.02.18.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 24 Jan 2017 02:18:11 -0800 (PST) From: Linus Walleij To: linux-mmc@vger.kernel.org, linux-block@vger.kernel.org, Ulf Hansson Cc: Chunyan Zhang , Baolin Wang , Paolo Valente , Linus Walleij Subject: [PATCH 2/6] mmc: block: break out mmc_blk_rw_start_new() Date: Tue, 24 Jan 2017 11:17:53 +0100 Message-Id: <20170124101757.19676-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170124101757.19676-1-linus.walleij@linaro.org> References: <20170124101757.19676-1-linus.walleij@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org 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 --- drivers/mmc/core/block.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) -- 2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }