]> www.infradead.org Git - users/willy/xarray.git/commitdiff
mmc: rename mmc_can_reset() to mmc_card_can_reset()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Tue, 1 Apr 2025 09:58:41 +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. Conversion was simplified by
inverting the logic.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20250401095847.29271-6-wsa+renesas@sang-engineering.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/mmc.c

index 7c6a0a79b7cf1ddc6d42a4f8813b04fd30d1043d..f39d7f9ed7c2438d517a0abd6c29cc029e8144d6 100644 (file)
@@ -2269,14 +2269,12 @@ static int mmc_runtime_resume(struct mmc_host *host)
        return 0;
 }
 
-static int mmc_can_reset(struct mmc_card *card)
+static bool mmc_card_can_reset(struct mmc_card *card)
 {
        u8 rst_n_function;
 
        rst_n_function = card->ext_csd.rst_n_function;
-       if ((rst_n_function & EXT_CSD_RST_N_EN_MASK) != EXT_CSD_RST_N_ENABLED)
-               return 0;
-       return 1;
+       return ((rst_n_function & EXT_CSD_RST_N_EN_MASK) == EXT_CSD_RST_N_ENABLED);
 }
 
 static int _mmc_hw_reset(struct mmc_host *host)
@@ -2290,7 +2288,7 @@ static int _mmc_hw_reset(struct mmc_host *host)
        _mmc_flush_cache(host);
 
        if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset &&
-            mmc_can_reset(card)) {
+            mmc_card_can_reset(card)) {
                /* If the card accept RST_n signal, send it. */
                mmc_set_clock(host, host->f_init);
                host->ops->card_hw_reset(host);