]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
mmc: rename mmc_can_discard() to mmc_card_can_discard()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 1 Apr 2025 09:58:37 +0000 (11:58 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 14 May 2025 14:59:17 +0000 (16:59 +0200)
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>
drivers/mmc/core/core.c
drivers/mmc/core/core.h
drivers/mmc/core/mmc.c

index ce08e0ea7fc1fdea915b658cad874e495202f7d3..8bc46ea370e86232032d10d6d2573ce29a0f07dc 100644 (file)
@@ -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)
 {
index fc9c066e6468f85400230e7e30fc10dc7d0093d3..e88b64379ab0e4f47ea85325e885e6f449d13d31 100644 (file)
@@ -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);
index 48656dadf93b85a1b07793bfc389020bd39a6fc3..7c4c26a61777ee06bae713983012409e6dd693de 100644 (file)
@@ -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;