Skip to content

Commit 76d62cd

Browse files
Wolfram SangUlf Hansson
authored andcommitted
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>
1 parent 7ea500b commit 76d62cd

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

drivers/mmc/core/core.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,17 +1854,15 @@ int mmc_can_trim(struct mmc_card *card)
18541854
}
18551855
EXPORT_SYMBOL(mmc_can_trim);
18561856

1857-
int mmc_can_discard(struct mmc_card *card)
1857+
bool mmc_card_can_discard(struct mmc_card *card)
18581858
{
18591859
/*
18601860
* As there's no way to detect the discard support bit at v4.5
18611861
* use the s/w feature support filed.
18621862
*/
1863-
if (card->ext_csd.feature_support & MMC_DISCARD_FEATURE)
1864-
return 1;
1865-
return 0;
1863+
return (card->ext_csd.feature_support & MMC_DISCARD_FEATURE);
18661864
}
1867-
EXPORT_SYMBOL(mmc_can_discard);
1865+
EXPORT_SYMBOL(mmc_card_can_discard);
18681866

18691867
int mmc_can_sanitize(struct mmc_card *card)
18701868
{

drivers/mmc/core/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ int mmc_start_request(struct mmc_host *host, struct mmc_request *mrq);
120120
int mmc_erase(struct mmc_card *card, sector_t from, unsigned int nr, unsigned int arg);
121121
int mmc_can_erase(struct mmc_card *card);
122122
int mmc_can_trim(struct mmc_card *card);
123-
int mmc_can_discard(struct mmc_card *card);
123+
bool mmc_card_can_discard(struct mmc_card *card);
124124
int mmc_can_sanitize(struct mmc_card *card);
125125
int mmc_can_secure_erase_trim(struct mmc_card *card);
126126
int mmc_erase_group_aligned(struct mmc_card *card, sector_t from, unsigned int nr);

drivers/mmc/core/mmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1804,7 +1804,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
18041804
}
18051805

18061806
/* set erase_arg */
1807-
if (mmc_can_discard(card))
1807+
if (mmc_card_can_discard(card))
18081808
card->erase_arg = MMC_DISCARD_ARG;
18091809
else if (mmc_can_trim(card))
18101810
card->erase_arg = MMC_TRIM_ARG;

0 commit comments

Comments
 (0)