mirror of https://gitee.com/openkylin/linux.git
mmc: core: Drop retries as in-parameter to mmc_wait_for_app_cmd()
All callers of mmc_wait_for_app_cmd() set the retries in-parameter to MMC_CMD_RETRIES. This is silly, so let's just drop the in-parameter altogether, as to simplify the code. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
9a4b869b0c
commit
03cd5c05d4
|
@ -53,22 +53,16 @@ int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
|
||||||
EXPORT_SYMBOL_GPL(mmc_app_cmd);
|
EXPORT_SYMBOL_GPL(mmc_app_cmd);
|
||||||
|
|
||||||
static int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
|
static int mmc_wait_for_app_cmd(struct mmc_host *host, struct mmc_card *card,
|
||||||
struct mmc_command *cmd, int retries)
|
struct mmc_command *cmd)
|
||||||
{
|
{
|
||||||
struct mmc_request mrq = {};
|
struct mmc_request mrq = {};
|
||||||
|
int i, err = -EIO;
|
||||||
int i, err;
|
|
||||||
|
|
||||||
if (retries < 0)
|
|
||||||
retries = MMC_CMD_RETRIES;
|
|
||||||
|
|
||||||
err = -EIO;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We have to resend MMC_APP_CMD for each attempt so
|
* We have to resend MMC_APP_CMD for each attempt so
|
||||||
* we cannot use the retries field in mmc_command.
|
* we cannot use the retries field in mmc_command.
|
||||||
*/
|
*/
|
||||||
for (i = 0;i <= retries;i++) {
|
for (i = 0; i <= MMC_CMD_RETRIES; i++) {
|
||||||
err = mmc_app_cmd(host, card);
|
err = mmc_app_cmd(host, card);
|
||||||
if (err) {
|
if (err) {
|
||||||
/* no point in retrying; no APP commands allowed */
|
/* no point in retrying; no APP commands allowed */
|
||||||
|
@ -121,7 +115,7 @@ int mmc_app_set_bus_width(struct mmc_card *card, int width)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mmc_wait_for_app_cmd(card->host, card, &cmd, MMC_CMD_RETRIES);
|
return mmc_wait_for_app_cmd(card->host, card, &cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
||||||
|
@ -137,7 +131,7 @@ int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr)
|
||||||
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
|
cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R3 | MMC_CMD_BCR;
|
||||||
|
|
||||||
for (i = 100; i; i--) {
|
for (i = 100; i; i--) {
|
||||||
err = mmc_wait_for_app_cmd(host, NULL, &cmd, MMC_CMD_RETRIES);
|
err = mmc_wait_for_app_cmd(host, NULL, &cmd);
|
||||||
if (err)
|
if (err)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue