mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 16:13:19 +09: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:
committed by
Ulf Hansson
parent
03e59b1e2f
commit
b71597edfa
@@ -993,7 +993,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
|
|||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
|
|
||||||
md->reset_done |= type;
|
md->reset_done |= type;
|
||||||
err = mmc_hw_reset(host);
|
err = mmc_hw_reset(host->card);
|
||||||
/* Ensure we switch back to the correct partition */
|
/* Ensure we switch back to the correct partition */
|
||||||
if (err) {
|
if (err) {
|
||||||
struct mmc_blk_data *main_md =
|
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
|
* 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
|
* 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
|
* 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
|
* 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;
|
int ret;
|
||||||
|
|
||||||
ret = host->bus_ops->hw_reset(host);
|
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)
|
static int mmc_test_reset(struct mmc_test_card *test)
|
||||||
{
|
{
|
||||||
struct mmc_card *card = test->card;
|
struct mmc_card *card = test->card;
|
||||||
struct mmc_host *host = card->host;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = mmc_hw_reset(host);
|
err = mmc_hw_reset(card);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
/*
|
/*
|
||||||
* Reset will re-enable the card's command queue, but tests
|
* 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = mmc_hw_reset(ar_sdio->func->card->host);
|
ret = mmc_hw_reset(ar_sdio->func->card);
|
||||||
if (ret)
|
if (ret)
|
||||||
ath10k_warn(ar, "unable to reset sdio: %d\n", 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 */
|
/* reset the adapter */
|
||||||
sdio_claim_host(sdiodev->func1);
|
sdio_claim_host(sdiodev->func1);
|
||||||
mmc_hw_reset(sdiodev->func1->card->host);
|
mmc_hw_reset(sdiodev->func1->card);
|
||||||
sdio_release_host(sdiodev->func1);
|
sdio_release_host(sdiodev->func1);
|
||||||
|
|
||||||
brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
|
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. */
|
/* Run a HW reset of the SDIO interface. */
|
||||||
sdio_claim_host(func);
|
sdio_claim_host(func);
|
||||||
ret = mmc_hw_reset(func->card->host);
|
ret = mmc_hw_reset(func->card);
|
||||||
sdio_release_host(func);
|
sdio_release_host(func);
|
||||||
|
|
||||||
switch (ret) {
|
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
|
* 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.
|
* 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_enable_func(func);
|
||||||
sdio_release_host(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 mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd,
|
||||||
int retries);
|
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);
|
int mmc_sw_reset(struct mmc_host *host);
|
||||||
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
|
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user