Commit 32f18e59 authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/20220408080045.6497-4-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 9723f69d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1988,9 +1988,9 @@ static void mmc_hw_reset_for_init(struct mmc_host *host)
{
	mmc_pwrseq_reset(host);

	if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
	if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->card_hw_reset)
		return;
	host->ops->hw_reset(host);
	host->ops->card_hw_reset(host);
}

/**
+2 −2
Original line number Diff line number Diff line
@@ -2225,11 +2225,11 @@ static int _mmc_hw_reset(struct mmc_host *host)
	 */
	_mmc_flush_cache(host);

	if ((host->caps & MMC_CAP_HW_RESET) && host->ops->hw_reset &&
	if ((host->caps & MMC_CAP_HW_RESET) && host->ops->card_hw_reset &&
	     mmc_can_reset(card)) {
		/* If the card accept RST_n signal, send it. */
		mmc_set_clock(host, host->f_init);
		host->ops->hw_reset(host);
		host->ops->card_hw_reset(host);
		/* Set initial state and call mmc_set_ios */
		mmc_set_initial_state(host);
	} else {
+1 −1
Original line number Diff line number Diff line
@@ -1259,7 +1259,7 @@ static void bcm2835_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
static const struct mmc_host_ops bcm2835_ops = {
	.request = bcm2835_request,
	.set_ios = bcm2835_set_ios,
	.hw_reset = bcm2835_reset,
	.card_hw_reset = bcm2835_reset,
};

static int bcm2835_add_host(struct bcm2835_host *host)
+1 −1
Original line number Diff line number Diff line
@@ -1812,7 +1812,7 @@ static const struct mmc_host_ops dw_mci_ops = {
	.set_ios		= dw_mci_set_ios,
	.get_ro			= dw_mci_get_ro,
	.get_cd			= dw_mci_get_cd,
	.hw_reset               = dw_mci_hw_reset,
	.card_hw_reset          = dw_mci_hw_reset,
	.enable_sdio_irq	= dw_mci_enable_sdio_irq,
	.ack_sdio_irq		= dw_mci_ack_sdio_irq,
	.execute_tuning		= dw_mci_execute_tuning,
+1 −1
Original line number Diff line number Diff line
@@ -511,7 +511,7 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
}

static const struct mmc_host_ops meson_mx_sdhc_ops = {
	.hw_reset			= meson_mx_sdhc_hw_reset,
	.card_hw_reset			= meson_mx_sdhc_hw_reset,
	.request			= meson_mx_sdhc_request,
	.set_ios			= meson_mx_sdhc_set_ios,
	.card_busy			= meson_mx_sdhc_card_busy,
Loading