mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-12 07:14:03 +08:00
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: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220408080045.6497-2-wsa+renesas@sang-engineering.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
parent
03e59b1e2f
commit
b71597edfa
@ -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 =
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -2639,7 +2639,7 @@ static void mwifiex_sdio_card_reset_work(struct mwifiex_adapter *adapter)
|
||||
|
||||
/* Run a HW reset of the SDIO interface. */
|
||||
sdio_claim_host(func);
|
||||
ret = mmc_hw_reset(func->card->host);
|
||||
ret = mmc_hw_reset(func->card);
|
||||
sdio_release_host(func);
|
||||
|
||||
switch (ret) {
|
||||
|
@ -146,7 +146,7 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
|
||||
* To guarantee that the SDIO card is power cycled, as required to make
|
||||
* the FW programming to succeed, let's do a brute force HW reset.
|
||||
*/
|
||||
mmc_hw_reset(card->host);
|
||||
mmc_hw_reset(card);
|
||||
|
||||
sdio_enable_func(func);
|
||||
sdio_release_host(func);
|
||||
|
@ -175,7 +175,7 @@ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq);
|
||||
int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd,
|
||||
int retries);
|
||||
|
||||
int mmc_hw_reset(struct mmc_host *host);
|
||||
int mmc_hw_reset(struct mmc_card *card);
|
||||
int mmc_sw_reset(struct mmc_host *host);
|
||||
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user