Skip to content

Commit b71597e

Browse files
Wolfram SangUlf Hansson
authored andcommitted
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>
1 parent 03e59b1 commit b71597e

8 files changed

Lines changed: 10 additions & 10 deletions

File tree

drivers/mmc/core/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
993993
return -EEXIST;
994994

995995
md->reset_done |= type;
996-
err = mmc_hw_reset(host);
996+
err = mmc_hw_reset(host->card);
997997
/* Ensure we switch back to the correct partition */
998998
if (err) {
999999
struct mmc_blk_data *main_md =

drivers/mmc/core/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1995,16 +1995,17 @@ static void mmc_hw_reset_for_init(struct mmc_host *host)
19951995

19961996
/**
19971997
* mmc_hw_reset - reset the card in hardware
1998-
* @host: MMC host to which the card is attached
1998+
* @card: card to be reset
19991999
*
20002000
* Hard reset the card. This function is only for upper layers, like the
20012001
* block layer or card drivers. You cannot use it in host drivers (struct
20022002
* mmc_card might be gone then).
20032003
*
20042004
* Return: 0 on success, -errno on failure
20052005
*/
2006-
int mmc_hw_reset(struct mmc_host *host)
2006+
int mmc_hw_reset(struct mmc_card *card)
20072007
{
2008+
struct mmc_host *host = card->host;
20082009
int ret;
20092010

20102011
ret = host->bus_ops->hw_reset(host);

drivers/mmc/core/mmc_test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,10 +2325,9 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
23252325
static int mmc_test_reset(struct mmc_test_card *test)
23262326
{
23272327
struct mmc_card *card = test->card;
2328-
struct mmc_host *host = card->host;
23292328
int err;
23302329

2331-
err = mmc_hw_reset(host);
2330+
err = mmc_hw_reset(card);
23322331
if (!err) {
23332332
/*
23342333
* Reset will re-enable the card's command queue, but tests

drivers/net/wireless/ath/ath10k/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1633,7 +1633,7 @@ static void ath10k_sdio_hif_power_down(struct ath10k *ar)
16331633
return;
16341634
}
16351635

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4165,7 +4165,7 @@ static int brcmf_sdio_bus_reset(struct device *dev)
41654165

41664166
/* reset the adapter */
41674167
sdio_claim_host(sdiodev->func1);
4168-
mmc_hw_reset(sdiodev->func1->card->host);
4168+
mmc_hw_reset(sdiodev->func1->card);
41694169
sdio_release_host(sdiodev->func1);
41704170

41714171
brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);

drivers/net/wireless/marvell/mwifiex/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,7 @@ static void mwifiex_sdio_card_reset_work(struct mwifiex_adapter *adapter)
26392639

26402640
/* Run a HW reset of the SDIO interface. */
26412641
sdio_claim_host(func);
2642-
ret = mmc_hw_reset(func->card->host);
2642+
ret = mmc_hw_reset(func->card);
26432643
sdio_release_host(func);
26442644

26452645
switch (ret) {

drivers/net/wireless/ti/wlcore/sdio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int wl12xx_sdio_power_on(struct wl12xx_sdio_glue *glue)
146146
* To guarantee that the SDIO card is power cycled, as required to make
147147
* the FW programming to succeed, let's do a brute force HW reset.
148148
*/
149-
mmc_hw_reset(card->host);
149+
mmc_hw_reset(card);
150150

151151
sdio_enable_func(func);
152152
sdio_release_host(func);

include/linux/mmc/core.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq);
175175
int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd,
176176
int retries);
177177

178-
int mmc_hw_reset(struct mmc_host *host);
178+
int mmc_hw_reset(struct mmc_card *card);
179179
int mmc_sw_reset(struct mmc_host *host);
180180
void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card);
181181

0 commit comments

Comments
 (0)