diff options
author | Victor Shih <victor.shih@genesyslogic.com.tw> | 2023-08-11 13:14:04 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2023-08-11 13:31:55 +0300 |
commit | 13433b9e2723947d636fb09fda68948b77833077 (patch) | |
tree | 3090cbfe86efa75159a031dc99db1e98cd2b3b43 /drivers | |
parent | da2a69cf278729dae1ad95811111457c8aac306b (diff) | |
download | linux-13433b9e2723947d636fb09fda68948b77833077.tar.xz |
mmc: core: Cleanup mmc_sd_num_wr_blocks() function
Use mmc_app_cmd() to avoid open-coding in mmc_sd_num_wr_blocks().
Signed-off-by: Victor Shih <victor.shih@genesyslogic.com.tw>
Link: https://lore.kernel.org/r/20230811101404.4463-1-victorshihgli@gmail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/core/block.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index 266298a04f78..b5b414a71e0b 100644 --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -918,17 +918,9 @@ static int mmc_sd_num_wr_blocks(struct mmc_card *card, u32 *written_blocks) struct scatterlist sg; - cmd.opcode = MMC_APP_CMD; - cmd.arg = card->rca << 16; - cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_AC; - - err = mmc_wait_for_cmd(card->host, &cmd, 0); + err = mmc_app_cmd(card->host, card); if (err) return err; - if (!mmc_host_is_spi(card->host) && !(cmd.resp[0] & R1_APP_CMD)) - return -EIO; - - memset(&cmd, 0, sizeof(struct mmc_command)); cmd.opcode = SD_APP_SEND_NUM_WR_BLKS; cmd.arg = 0; |