diff options
author | 2021-04-14 23:22:35 +0200 | |
---|---|---|
committer | 2021-04-15 13:43:17 +0200 | |
commit | 5e52a168be3775c06cce279b03d156efbad5478b (patch) | |
tree | a044a8fc9bbd591ba0a4219b7fe96eb49e043abd /drivers/mmc/core/mmc_ops.c | |
parent | memstick: r592: remove unused variable (diff) | |
download | linux-dev-5e52a168be3775c06cce279b03d156efbad5478b.tar.xz linux-dev-5e52a168be3775c06cce279b03d156efbad5478b.zip |
mmc: core: Add a retries parameter to __mmc_switch function
Add command retries parameter to __mmc_switch(), let caller
pass retries according to the caller's condition.
Signed-off-by: Bean Huo <beanhuo@micron.com>
Link: https://lore.kernel.org/r/20210414212236.346813-2-huobean@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/mmc_ops.c')
-rw-r--r-- | drivers/mmc/core/mmc_ops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mmc/core/mmc_ops.c b/drivers/mmc/core/mmc_ops.c index ccca067db993..1ca0c89081be 100644 --- a/drivers/mmc/core/mmc_ops.c +++ b/drivers/mmc/core/mmc_ops.c @@ -532,12 +532,13 @@ int mmc_poll_for_busy(struct mmc_card *card, unsigned int timeout_ms, * @timing: new timing to change to * @send_status: send status cmd to poll for busy * @retry_crc_err: retry when CRC errors when polling with CMD13 for busy + * @retries: number of retries * * Modifies the EXT_CSD register for selected card. */ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, unsigned int timeout_ms, unsigned char timing, - bool send_status, bool retry_crc_err) + bool send_status, bool retry_crc_err, unsigned int retries) { struct mmc_host *host = card->host; int err; @@ -577,7 +578,7 @@ int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, cmd.flags |= MMC_RSP_SPI_R1 | MMC_RSP_R1; } - err = mmc_wait_for_cmd(host, &cmd, MMC_CMD_RETRIES); + err = mmc_wait_for_cmd(host, &cmd, retries); if (err) goto out; @@ -612,7 +613,7 @@ int mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value, unsigned int timeout_ms) { return __mmc_switch(card, set, index, value, timeout_ms, 0, - true, false); + true, false, MMC_CMD_RETRIES); } EXPORT_SYMBOL_GPL(mmc_switch); |