diff options
author | 2025-04-01 11:58:37 +0200 | |
---|---|---|
committer | 2025-05-14 16:59:17 +0200 | |
commit | 76d62cde684ba53dcbc6923b2ec90a024ee253f9 (patch) | |
tree | b1aeaae0758febec37458f57c415f21cd8ec62ac /drivers/mmc | |
parent | mmc: alcor: Use str_read_write() helper (diff) | |
download | wireguard-linux-76d62cde684ba53dcbc6923b2ec90a024ee253f9.tar.xz wireguard-linux-76d62cde684ba53dcbc6923b2ec90a024ee253f9.zip |
mmc: rename mmc_can_discard() to mmc_card_can_discard()
mmc_can_* functions sometimes relate to the card and sometimes to the host.
Make it obvious by renaming this function to include 'card'. Also, convert to
proper bool type while we are here.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250401095847.29271-2-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/core.c | 8 | ||||
-rw-r--r-- | drivers/mmc/core/core.h | 2 | ||||
-rw-r--r-- | drivers/mmc/core/mmc.c | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index ce08e0ea7fc1..8bc46ea370e8 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -1854,17 +1854,15 @@ int mmc_can_trim(struct mmc_card *card) } EXPORT_SYMBOL(mmc_can_trim); -int mmc_can_discard(struct mmc_card *card) +bool mmc_card_can_discard(struct mmc_card *card) { /* * As there's no way to detect the discard support bit at v4.5 * use the s/w feature support filed. */ - if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE) - return 1; - return 0; + return (card->ext_csd.feature_support & MMC_DISCARD_FEATURE); } -EXPORT_SYMBOL(mmc_can_discard); +EXPORT_SYMBOL(mmc_card_can_discard); int mmc_can_sanitize(struct mmc_card *card) { diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index fc9c066e6468..e88b64379ab0 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -120,7 +120,7 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq); int mmc_erase(struct mmc_card *card, sector_t from, unsigned int nr, unsigned int arg); int mmc_can_erase(struct mmc_card *card); int mmc_can_trim(struct mmc_card *card); -int mmc_can_discard(struct mmc_card *card); +bool mmc_card_can_discard(struct mmc_card *card); int mmc_can_sanitize(struct mmc_card *card); int mmc_can_secure_erase_trim(struct mmc_card *card); int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr); diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 48656dadf93b..7c4c26a61777 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1804,7 +1804,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, } /* set erase_arg */ - if (mmc_can_discard(card)) + if (mmc_card_can_discard(card)) card->erase_arg = MMC_DISCARD_ARG; else if (mmc_can_trim(card)) card->erase_arg = MMC_TRIM_ARG; |