Commit 8ddfe07e authored by Adrian Hunter's avatar Adrian Hunter Committed by Ulf Hansson

mmc: block: Use local var for mqrq_cur

A subsequent patch will remove 'mq->mqrq_cur'. Prepare for that by
assigning it to a local variable.
Signed-off-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent e584e075
...@@ -1597,7 +1597,8 @@ static void mmc_blk_rw_cmd_abort(struct mmc_card *card, struct request *req) ...@@ -1597,7 +1597,8 @@ static void mmc_blk_rw_cmd_abort(struct mmc_card *card, struct request *req)
* @mq: the queue with the card and host to restart * @mq: the queue with the card and host to restart
* @req: a new request that want to be started after the current one * @req: a new request that want to be started after the current one
*/ */
static void mmc_blk_rw_try_restart(struct mmc_queue *mq, struct request *req) static void mmc_blk_rw_try_restart(struct mmc_queue *mq, struct request *req,
struct mmc_queue_req *mqrq)
{ {
if (!req) if (!req)
return; return;
...@@ -1611,8 +1612,8 @@ static void mmc_blk_rw_try_restart(struct mmc_queue *mq, struct request *req) ...@@ -1611,8 +1612,8 @@ static void mmc_blk_rw_try_restart(struct mmc_queue *mq, struct request *req)
return; return;
} }
/* Else proceed and try to restart the current async request */ /* Else proceed and try to restart the current async request */
mmc_blk_rw_rq_prep(mq->mqrq_cur, mq->card, 0, mq); mmc_blk_rw_rq_prep(mqrq, mq->card, 0, mq);
mmc_start_areq(mq->card->host, &mq->mqrq_cur->areq, NULL); mmc_start_areq(mq->card->host, &mqrq->areq, NULL);
} }
static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
...@@ -1622,6 +1623,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1622,6 +1623,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
struct mmc_blk_request *brq; struct mmc_blk_request *brq;
int disable_multi = 0, retry = 0, type, retune_retry_done = 0; int disable_multi = 0, retry = 0, type, retune_retry_done = 0;
enum mmc_blk_status status; enum mmc_blk_status status;
struct mmc_queue_req *mqrq_cur = mq->mqrq_cur;
struct mmc_queue_req *mq_rq; struct mmc_queue_req *mq_rq;
struct request *old_req; struct request *old_req;
struct mmc_async_req *new_areq; struct mmc_async_req *new_areq;
...@@ -1645,8 +1647,8 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1645,8 +1647,8 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
return; return;
} }
mmc_blk_rw_rq_prep(mq->mqrq_cur, card, 0, mq); mmc_blk_rw_rq_prep(mqrq_cur, card, 0, mq);
new_areq = &mq->mqrq_cur->areq; new_areq = &mqrq_cur->areq;
} else } else
new_areq = NULL; new_areq = NULL;
...@@ -1700,11 +1702,11 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1700,11 +1702,11 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
if (mmc_blk_reset(md, card->host, type)) { if (mmc_blk_reset(md, card->host, type)) {
if (req_pending) if (req_pending)
mmc_blk_rw_cmd_abort(card, old_req); mmc_blk_rw_cmd_abort(card, old_req);
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
} }
if (!req_pending) { if (!req_pending) {
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
} }
break; break;
...@@ -1717,7 +1719,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1717,7 +1719,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
if (!mmc_blk_reset(md, card->host, type)) if (!mmc_blk_reset(md, card->host, type))
break; break;
mmc_blk_rw_cmd_abort(card, old_req); mmc_blk_rw_cmd_abort(card, old_req);
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
case MMC_BLK_DATA_ERR: { case MMC_BLK_DATA_ERR: {
int err; int err;
...@@ -1727,7 +1729,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1727,7 +1729,7 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
break; break;
if (err == -ENODEV) { if (err == -ENODEV) {
mmc_blk_rw_cmd_abort(card, old_req); mmc_blk_rw_cmd_abort(card, old_req);
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
} }
/* Fall through */ /* Fall through */
...@@ -1748,19 +1750,19 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) ...@@ -1748,19 +1750,19 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req)
req_pending = blk_end_request(old_req, -EIO, req_pending = blk_end_request(old_req, -EIO,
brq->data.blksz); brq->data.blksz);
if (!req_pending) { if (!req_pending) {
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
} }
break; break;
case MMC_BLK_NOMEDIUM: case MMC_BLK_NOMEDIUM:
mmc_blk_rw_cmd_abort(card, old_req); mmc_blk_rw_cmd_abort(card, old_req);
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
default: default:
pr_err("%s: Unhandled return value (%d)", pr_err("%s: Unhandled return value (%d)",
old_req->rq_disk->disk_name, status); old_req->rq_disk->disk_name, status);
mmc_blk_rw_cmd_abort(card, old_req); mmc_blk_rw_cmd_abort(card, old_req);
mmc_blk_rw_try_restart(mq, new_req); mmc_blk_rw_try_restart(mq, new_req, mqrq_cur);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment