From: Wolfram Sang Date: Tue, 1 Apr 2025 09:58:41 +0000 (+0200) Subject: mmc: rename mmc_can_reset() to mmc_card_can_reset() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=07dd2b3204f5fe3010dd467c0a192d7efabc1abc;p=users%2Fdwmw2%2Flinux.git mmc: rename mmc_can_reset() to mmc_card_can_reset() 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 Link: https://lore.kernel.org/r/20250401095847.29271-6-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 7c6a0a79b7cf1..f39d7f9ed7c24 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -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);