The same code is used in a couple of places. Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx> --- drivers/mmc/card/block.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 17ce02a0fb48..aac6e2e77dfd 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1320,6 +1320,13 @@ static int mmc_blk_issue_flush(struct mmc_queue *mq, struct request *req) return ret ? 0 : 1; } +static void mmc_blk_requeue(struct request_queue *q, struct request *req) +{ + spin_lock_irq(q->queue_lock); + blk_requeue_request(q, req); + spin_unlock_irq(q->queue_lock); +} + /* * Reformat current write as a reliable write, supporting * both legacy and the enhanced reliable write MMC cards. @@ -1780,11 +1787,8 @@ static u8 mmc_blk_prep_packed_list(struct mmc_queue *mq, struct request *req) reqs++; } while (1); - if (put_back) { - spin_lock_irq(q->queue_lock); - blk_requeue_request(q, next); - spin_unlock_irq(q->queue_lock); - } + if (put_back) + mmc_blk_requeue(q, next); if (reqs > 0) { list_add(&req->queuelist, &mqrq->packed->list); @@ -1971,9 +1975,7 @@ static void mmc_blk_revert_packed_req(struct mmc_queue *mq, prq = list_entry_rq(packed->list.prev); if (prq->queuelist.prev != &packed->list) { list_del_init(&prq->queuelist); - spin_lock_irq(q->queue_lock); - blk_requeue_request(mq->queue, prq); - spin_unlock_irq(q->queue_lock); + mmc_blk_requeue(q, prq); } else { list_del_init(&prq->queuelist); } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html