Skip to content

Commit 32f18e5

Browse files
Wolfram Sangstorulf
authored andcommitted
mmc: improve API to make clear hw_reset callback is for cards
To make it unambiguous that the hw_reset callback is for cards and not for controllers, we add 'card' to the callback name and convert all users in one go. We keep the argument as mmc_host, though, because the callback is used very early when mmc_card is not yet populated. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Link: https://lore.kernel.org/r/20220408080045.6497-4-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 9723f69 commit 32f18e5

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

drivers/mmc/core/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1988,9 +1988,9 @@ static void mmc_hw_reset_for_init(struct mmc_host *host)
19881988
{
19891989
mmc_pwrseq_reset(host);
19901990

1991-
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
1991+
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->card_hw_reset)
19921992
return;
1993-
host->ops->hw_reset(host);
1993+
host->ops->card_hw_reset(host);
19941994
}
19951995

19961996
/**

drivers/mmc/core/mmc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2225,11 +2225,11 @@ static int _mmc_hw_reset(struct mmc_host *host)
22252225
*/
22262226
_mmc_flush_cache(host);
22272227

2228-
if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
2228+
if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset &&
22292229
mmc_can_reset(card)) {
22302230
/* If the card accept RST_n signal, send it. */
22312231
mmc_set_clock(host, host->f_init);
2232-
host->ops->hw_reset(host);
2232+
host->ops->card_hw_reset(host);
22332233
/* Set initial state and call mmc_set_ios */
22342234
mmc_set_initial_state(host);
22352235
} else {

drivers/mmc/host/bcm2835.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ static void bcm2835_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
12591259
static const struct mmc_host_ops bcm2835_ops = {
12601260
.request = bcm2835_request,
12611261
.set_ios = bcm2835_set_ios,
1262-
.hw_reset = bcm2835_reset,
1262+
.card_hw_reset = bcm2835_reset,
12631263
};
12641264

12651265
static int bcm2835_add_host(struct bcm2835_host *host)

drivers/mmc/host/dw_mmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,7 @@ static const struct mmc_host_ops dw_mci_ops = {
18121812
.set_ios = dw_mci_set_ios,
18131813
.get_ro = dw_mci_get_ro,
18141814
.get_cd = dw_mci_get_cd,
1815-
.hw_reset = dw_mci_hw_reset,
1815+
.card_hw_reset = dw_mci_hw_reset,
18161816
.enable_sdio_irq = dw_mci_enable_sdio_irq,
18171817
.ack_sdio_irq = dw_mci_ack_sdio_irq,
18181818
.execute_tuning = dw_mci_execute_tuning,

drivers/mmc/host/meson-mx-sdhc-mmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
511511
}
512512

513513
static const struct mmc_host_ops meson_mx_sdhc_ops = {
514-
.hw_reset = meson_mx_sdhc_hw_reset,
514+
.card_hw_reset = meson_mx_sdhc_hw_reset,
515515
.request = meson_mx_sdhc_request,
516516
.set_ios = meson_mx_sdhc_set_ios,
517517
.card_busy = meson_mx_sdhc_card_busy,

drivers/mmc/host/mtk-sd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2458,7 +2458,7 @@ static const struct mmc_host_ops mt_msdc_ops = {
24582458
.execute_tuning = msdc_execute_tuning,
24592459
.prepare_hs400_tuning = msdc_prepare_hs400_tuning,
24602460
.execute_hs400_tuning = msdc_execute_hs400_tuning,
2461-
.hw_reset = msdc_hw_reset,
2461+
.card_hw_reset = msdc_hw_reset,
24622462
};
24632463

24642464
static const struct cqhci_host_ops msdc_cmdq_ops = {

drivers/mmc/host/sdhci.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2999,7 +2999,7 @@ static const struct mmc_host_ops sdhci_ops = {
29992999
.set_ios = sdhci_set_ios,
30003000
.get_cd = sdhci_get_cd,
30013001
.get_ro = sdhci_get_ro,
3002-
.hw_reset = sdhci_hw_reset,
3002+
.card_hw_reset = sdhci_hw_reset,
30033003
.enable_sdio_irq = sdhci_enable_sdio_irq,
30043004
.ack_sdio_irq = sdhci_ack_sdio_irq,
30053005
.start_signal_voltage_switch = sdhci_start_signal_voltage_switch,

drivers/mmc/host/sunxi-mmc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ static const struct mmc_host_ops sunxi_mmc_ops = {
11151115
.get_cd = mmc_gpio_get_cd,
11161116
.enable_sdio_irq = sunxi_mmc_enable_sdio_irq,
11171117
.start_signal_voltage_switch = sunxi_mmc_volt_switch,
1118-
.hw_reset = sunxi_mmc_hw_reset,
1118+
.card_hw_reset = sunxi_mmc_hw_reset,
11191119
.card_busy = sunxi_mmc_card_busy,
11201120
};
11211121

drivers/mmc/host/uniphier-sd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ static int uniphier_sd_probe(struct platform_device *pdev)
597597
ret = PTR_ERR(priv->rst_hw);
598598
goto free_host;
599599
}
600-
host->ops.hw_reset = uniphier_sd_hw_reset;
600+
host->ops.card_hw_reset = uniphier_sd_hw_reset;
601601
}
602602

603603
if (host->mmc->caps & MMC_CAP_UHS) {

include/linux/mmc/host.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ struct mmc_host_ops {
181181
unsigned int max_dtr, int host_drv,
182182
int card_drv, int *drv_type);
183183
/* Reset the eMMC card via RST_n */
184-
void (*hw_reset)(struct mmc_host *host);
184+
void (*card_hw_reset)(struct mmc_host *host);
185185
void (*card_event)(struct mmc_host *host);
186186

187187
/*

0 commit comments

Comments
 (0)