Skip to content

Commit 07dd2b3

Browse files
Wolfram SangUlf Hansson
authored andcommitted
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 <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>
1 parent d872c26 commit 07dd2b3

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

drivers/mmc/core/mmc.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2269,14 +2269,12 @@ static int mmc_runtime_resume(struct mmc_host *host)
22692269
return 0;
22702270
}
22712271

2272-
static int mmc_can_reset(struct mmc_card *card)
2272+
static bool mmc_card_can_reset(struct mmc_card *card)
22732273
{
22742274
u8 rst_n_function;
22752275

22762276
rst_n_function = card->ext_csd.rst_n_function;
2277-
if ((rst_n_function & EXT_CSD_RST_N_EN_MASK) != EXT_CSD_RST_N_ENABLED)
2278-
return 0;
2279-
return 1;
2277+
return ((rst_n_function & EXT_CSD_RST_N_EN_MASK) == EXT_CSD_RST_N_ENABLED);
22802278
}
22812279

22822280
static int _mmc_hw_reset(struct mmc_host *host)
@@ -2290,7 +2288,7 @@ static int _mmc_hw_reset(struct mmc_host *host)
22902288
_mmc_flush_cache(host);
22912289

22922290
if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset &&
2293-
mmc_can_reset(card)) {
2291+
mmc_card_can_reset(card)) {
22942292
/* If the card accept RST_n signal, send it. */
22952293
mmc_set_clock(host, host->f_init);
22962294
host->ops->card_hw_reset(host);

0 commit comments

Comments
 (0)