Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5744d50d authored by Linus Walleij's avatar Linus Walleij Committed by Ulf Hansson
Browse files

mmc: core: move some code in mmc_start_areq()



"previous" is a better name for the variable storing the previous
asynchronous request, better than the opaque name "data" atleast.
We see that we assign the return status to the returned variable
on all code paths, so we might as well just do that immediately
after calling mmc_finalize_areq().

Reviewed-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent f34bdd2f
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -704,7 +704,7 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,
{
	enum mmc_blk_status status;
	int start_err = 0;
	struct mmc_async_req *data = host->areq;
	struct mmc_async_req *previous = host->areq;

	/* Prepare a new request */
	if (areq)
@@ -712,13 +712,12 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,

	/* Finalize previous request */
	status = mmc_finalize_areq(host);

	/* The previous request is still going on... */
	if (status == MMC_BLK_NEW_REQUEST) {
	if (ret_stat)
		*ret_stat = status;

	/* The previous request is still going on... */
	if (status == MMC_BLK_NEW_REQUEST)
		return NULL;
	}

	/* Fine so far, start the new request! */
	if (status == MMC_BLK_SUCCESS && areq)
@@ -737,9 +736,7 @@ struct mmc_async_req *mmc_start_areq(struct mmc_host *host,
	else
		host->areq = areq;

	if (ret_stat)
		*ret_stat = status;
	return data;
	return previous;
}
EXPORT_SYMBOL(mmc_start_areq);