From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: linux-mmc@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
Wolfram Sang <wsa+renesas@sang-engineering.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [RFC PATCH 09/10] mmc: core: improve API to make clear sw_reset from bus_ops is for cards
Date: Mon, 21 Mar 2022 12:50:55 +0100 [thread overview]
Message-ID: <20220321115059.21803-10-wsa+renesas@sang-engineering.com> (raw)
In-Reply-To: <20220321115059.21803-1-wsa+renesas@sang-engineering.com>
To make it unambiguous that bus_ops->sw_reset() is for cards and not for
controllers, we a) add 'card' to the function name and b) make the
function argument mmc_card instead of mmc_host. All users are converted,
too.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/core/core.c | 4 ++--
drivers/mmc/core/core.h | 2 +-
drivers/mmc/core/sdio.c | 6 ++++--
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 1d874b064202..7e48570007f9 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2023,10 +2023,10 @@ int mmc_card_sw_reset(struct mmc_card *card)
struct mmc_host *host = card->host;
int ret;
- if (!host->bus_ops->sw_reset)
+ if (!host->bus_ops->card_sw_reset)
return -EOPNOTSUPP;
- ret = host->bus_ops->sw_reset(host);
+ ret = host->bus_ops->card_sw_reset(card);
if (ret)
pr_warn("%s: tried to SW reset card, got error %d\n",
mmc_hostname(host), ret);
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h
index c54270a6d457..27e8435ae779 100644
--- a/drivers/mmc/core/core.h
+++ b/drivers/mmc/core/core.h
@@ -28,7 +28,7 @@ struct mmc_bus_ops {
int (*alive)(struct mmc_host *);
int (*shutdown)(struct mmc_host *);
int (*card_hw_reset)(struct mmc_card *);
- int (*sw_reset)(struct mmc_host *);
+ int (*card_sw_reset)(struct mmc_card *);
bool (*cache_enabled)(struct mmc_host *);
int (*flush_cache)(struct mmc_host *);
};
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 30242faf703e..e6460285b46b 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -1154,8 +1154,10 @@ static int mmc_sdio_card_hw_reset(struct mmc_card *card)
return mmc_sdio_reinit_card(host);
}
-static int mmc_sdio_sw_reset(struct mmc_host *host)
+static int mmc_sdio_card_sw_reset(struct mmc_card *card)
{
+ struct mmc_host *host = card->host;
+
mmc_set_clock(host, host->f_init);
sdio_reset(host);
mmc_go_idle(host);
@@ -1176,7 +1178,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = {
.runtime_resume = mmc_sdio_runtime_resume,
.alive = mmc_sdio_alive,
.card_hw_reset = mmc_sdio_card_hw_reset,
- .sw_reset = mmc_sdio_sw_reset,
+ .card_sw_reset = mmc_sdio_card_sw_reset,
};
--
2.30.2
next prev parent reply other threads:[~2022-03-21 11:51 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-21 11:50 [RFC PATCH 00/10] mmc: improve API to make clear {h|s}w_reset is for cards Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 01/10] mmc: core: improve API to make clear mmc_hw_reset " Wolfram Sang
2022-04-04 12:05 ` Ulf Hansson
2022-04-06 7:58 ` Wolfram Sang
2022-04-06 13:53 ` Ulf Hansson
2022-04-07 20:24 ` Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 02/10] ath10k: sdio: update to new MMC API for resetting cards Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 03/10] brcmfmac: " Wolfram Sang
2022-03-21 11:57 ` Arend van Spriel
2022-03-21 11:50 ` [RFC PATCH 04/10] mwifiex: " Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 05/10] wlcore: " Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 06/10] mmc: core: remove fallback for mmc_hw_reset() Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 07/10] mmc: core: improve API to make clear that mmc_sw_reset is for cards Wolfram Sang
2022-03-21 11:50 ` [RFC PATCH 08/10] mmc: core: improve API to make clear hw_reset from bus_ops " Wolfram Sang
2022-04-04 12:13 ` Ulf Hansson
2022-04-06 8:02 ` Wolfram Sang
2022-04-06 13:58 ` Ulf Hansson
2022-04-07 20:26 ` Wolfram Sang
2022-03-21 11:50 ` Wolfram Sang [this message]
2022-03-21 11:50 ` [RFC PATCH 10/10] mmc: improve API to make clear hw_reset callback " Wolfram Sang
2022-03-22 6:43 ` [RFC PATCH 00/10] mmc: improve API to make clear {h|s}w_reset " Wolfram Sang
2022-04-01 16:25 ` Wolfram Sang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220321115059.21803-10-wsa+renesas@sang-engineering.com \
--to=wsa+renesas@sang-engineering.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).