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

mmc: core: improve API to make clear mmc_hw_reset is for cards



To make it unambiguous that mmc_hw_reset() is for cards and not for
controllers, we make the function argument mmc_card instead of mmc_host.
Also, all users are converted.

Suggested-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220408080045.6497-2-wsa+renesas@sang-engineering.com


Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 03e59b1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -993,7 +993,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
		return -EEXIST;

	md->reset_done |= type;
	err = mmc_hw_reset(host);
	err = mmc_hw_reset(host->card);
	/* Ensure we switch back to the correct partition */
	if (err) {
		struct mmc_blk_data *main_md =
+3 −2
Original line number Diff line number Diff line
@@ -1995,7 +1995,7 @@ static void mmc_hw_reset_for_init(struct mmc_host *host)

/**
 * mmc_hw_reset - reset the card in hardware
 * @host: MMC host to which the card is attached
 * @card: card to be reset
 *
 * Hard reset the card. This function is only for upper layers, like the
 * block layer or card drivers. You cannot use it in host drivers (struct
@@ -2003,8 +2003,9 @@ static void mmc_hw_reset_for_init(struct mmc_host *host)
 *
 * Return: 0 on success, -errno on failure
 */
int mmc_hw_reset(struct mmc_host *host)
int mmc_hw_reset(struct mmc_card *card)
{
	struct mmc_host *host = card->host;
	int ret;

	ret = host->bus_ops->hw_reset(host);
+1 −2
Original line number Diff line number Diff line
@@ -2325,10 +2325,9 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
static int mmc_test_reset(struct mmc_test_card *test)
{
	struct mmc_card *card = test->card;
	struct mmc_host *host = card->host;
	int err;

	err = mmc_hw_reset(host);
	err = mmc_hw_reset(card);
	if (!err) {
		/*
		 * Reset will re-enable the card's command queue, but tests
+1 −1
Original line number Diff line number Diff line
@@ -1633,7 +1633,7 @@ static void ath10k_sdio_hif_power_down(struct ath10k *ar)
		return;
	}

	ret = mmc_hw_reset(ar_sdio->func->card->host);
	ret = mmc_hw_reset(ar_sdio->func->card);
	if (ret)
		ath10k_warn(ar, "unable to reset sdio: %d\n", ret);

+1 −1
Original line number Diff line number Diff line
@@ -4165,7 +4165,7 @@ static int brcmf_sdio_bus_reset(struct device *dev)

	/* reset the adapter */
	sdio_claim_host(sdiodev->func1);
	mmc_hw_reset(sdiodev->func1->card->host);
	mmc_hw_reset(sdiodev->func1->card);
	sdio_release_host(sdiodev->func1);

	brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
Loading