Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Wolfram Sang and committed by
Ulf Hansson
b71597ed 03e59b1e

+10 -10
+1 -1
drivers/mmc/core/block.c
··· 993 993 return -EEXIST; 994 994 995 995 md->reset_done |= type; 996 - err = mmc_hw_reset(host); 996 + err = mmc_hw_reset(host->card); 997 997 /* Ensure we switch back to the correct partition */ 998 998 if (err) { 999 999 struct mmc_blk_data *main_md =
+3 -2
drivers/mmc/core/core.c
··· 1995 1995 1996 1996 /** 1997 1997 * mmc_hw_reset - reset the card in hardware 1998 - * @host: MMC host to which the card is attached 1998 + * @card: card to be reset 1999 1999 * 2000 2000 * Hard reset the card. This function is only for upper layers, like the 2001 2001 * block layer or card drivers. You cannot use it in host drivers (struct ··· 2003 2003 * 2004 2004 * Return: 0 on success, -errno on failure 2005 2005 */ 2006 - int mmc_hw_reset(struct mmc_host *host) 2006 + int mmc_hw_reset(struct mmc_card *card) 2007 2007 { 2008 + struct mmc_host *host = card->host; 2008 2009 int ret; 2009 2010 2010 2011 ret = host->bus_ops->hw_reset(host);
+1 -2
drivers/mmc/core/mmc_test.c
··· 2325 2325 static int mmc_test_reset(struct mmc_test_card *test) 2326 2326 { 2327 2327 struct mmc_card *card = test->card; 2328 - struct mmc_host *host = card->host; 2329 2328 int err; 2330 2329 2331 - err = mmc_hw_reset(host); 2330 + err = mmc_hw_reset(card); 2332 2331 if (!err) { 2333 2332 /* 2334 2333 * Reset will re-enable the card's command queue, but tests
+1 -1
drivers/net/wireless/ath/ath10k/sdio.c
··· 1633 1633 return; 1634 1634 } 1635 1635 1636 - ret = mmc_hw_reset(ar_sdio->func->card->host); 1636 + ret = mmc_hw_reset(ar_sdio->func->card); 1637 1637 if (ret) 1638 1638 ath10k_warn(ar, "unable to reset sdio: %d\n", ret); 1639 1639
+1 -1
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c
··· 4165 4165 4166 4166 /* reset the adapter */ 4167 4167 sdio_claim_host(sdiodev->func1); 4168 - mmc_hw_reset(sdiodev->func1->card->host); 4168 + mmc_hw_reset(sdiodev->func1->card); 4169 4169 sdio_release_host(sdiodev->func1); 4170 4170 4171 4171 brcmf_bus_change_state(sdiodev->bus_if, BRCMF_BUS_DOWN);
+1 -1
drivers/net/wireless/marvell/mwifiex/sdio.c
··· 2639 2639 2640 2640 /* Run a HW reset of the SDIO interface. */ 2641 2641 sdio_claim_host(func); 2642 - ret = mmc_hw_reset(func->card->host); 2642 + ret = mmc_hw_reset(func->card); 2643 2643 sdio_release_host(func); 2644 2644 2645 2645 switch (ret) {
+1 -1
drivers/net/wireless/ti/wlcore/sdio.c
··· 146 146 * To guarantee that the SDIO card is power cycled, as required to make 147 147 * the FW programming to succeed, let's do a brute force HW reset. 148 148 */ 149 - mmc_hw_reset(card->host); 149 + mmc_hw_reset(card); 150 150 151 151 sdio_enable_func(func); 152 152 sdio_release_host(func);
+1 -1
include/linux/mmc/core.h
··· 175 175 int mmc_wait_for_cmd(struct mmc_host *host, struct mmc_command *cmd, 176 176 int retries); 177 177 178 - int mmc_hw_reset(struct mmc_host *host); 178 + int mmc_hw_reset(struct mmc_card *card); 179 179 int mmc_sw_reset(struct mmc_host *host); 180 180 void mmc_set_data_timeout(struct mmc_data *data, const struct mmc_card *card); 181 181