summaryrefslogtreecommitdiff
path: root/drivers/mmc/core
diff options
context:
space:
mode:
authorJohan Rudholm <johan.rudholm@axis.com>2015-01-12 17:38:04 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2015-01-19 11:56:27 +0300
commit83533ab28380f6957af39a7b322e639e42dbdaf1 (patch)
tree2b7a8f3e11e0beef743e13fbf2862605b279d611 /drivers/mmc/core
parent25185f3f31c924eecc6ff4f55f7acceabf24de11 (diff)
downloadlinux-83533ab28380f6957af39a7b322e639e42dbdaf1.tar.xz
mmc: core: always check status after reset
Always check if the card is alive after a successful reset. This allows us to remove mmc_hw_reset_check(), leaving mmc_hw_reset() as the only card reset interface. Signed-off-by: Johan Rudholm <johanru@axis.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core')
-rw-r--r--drivers/mmc/core/core.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index d3bfbdfab052..72070f188cc5 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2286,9 +2286,10 @@ int mmc_can_reset(struct mmc_card *card)
}
EXPORT_SYMBOL(mmc_can_reset);
-static int mmc_do_hw_reset(struct mmc_host *host, int check)
+int mmc_hw_reset(struct mmc_host *host)
{
struct mmc_card *card = host->card;
+ u32 status;
if (!(host->caps & MMC_CAP_HW_RESET) || !host->ops->hw_reset)
return -EOPNOTSUPP;
@@ -2305,13 +2306,9 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check)
host->ops->hw_reset(host);
/* If the reset has happened, then a status command will fail */
- if (check) {
- u32 status;
-
- if (!mmc_send_status(card, &status)) {
- mmc_host_clk_release(host);
- return -ENOSYS;
- }
+ if (!mmc_send_status(card, &status)) {
+ mmc_host_clk_release(host);
+ return -ENOSYS;
}
/* Set initial state and call mmc_set_ios */
@@ -2321,19 +2318,8 @@ static int mmc_do_hw_reset(struct mmc_host *host, int check)
return host->bus_ops->power_restore(host);
}
-
-int mmc_hw_reset(struct mmc_host *host)
-{
- return mmc_do_hw_reset(host, 0);
-}
EXPORT_SYMBOL(mmc_hw_reset);
-int mmc_hw_reset_check(struct mmc_host *host)
-{
- return mmc_do_hw_reset(host, 1);
-}
-EXPORT_SYMBOL(mmc_hw_reset_check);
-
static int mmc_rescan_try_freq(struct mmc_host *host, unsigned freq)
{
host->f_init = freq;