[PATCH v4 1/4] mmc: core: select HS400 from HS200 tuning function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Call mmc_select_hs400() from mmc_hs200_tuning().

This should have no run-time effect as the existing call to
mmc_select_hs400() is right after a call to mmc_hs200_tuning() in
mmc_init_card() and that is the only caller of mmc_hs200_tuning().

This is in preparation for adding a new mmc_host_opp to be called
after tuning and selecting HS400 - or in other words,
after mmc_execute_tuning() and mmc_select_hs400().

Signed-off-by: Simon Horman <horms+renesas@xxxxxxxxxxxx>
---
v4
- New patch
---
 drivers/mmc/core/mmc.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 6f8ebd6caa4c..099b327e10ca 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1508,6 +1508,7 @@ static int mmc_select_timing(struct mmc_card *card)
 static int mmc_hs200_tuning(struct mmc_card *card)
 {
 	struct mmc_host *host = card->host;
+	int err;
 
 	/*
 	 * Timing should be adjusted to the HS400 target
@@ -1518,7 +1519,11 @@ static int mmc_hs200_tuning(struct mmc_card *card)
 		if (host->ops->prepare_hs400_tuning)
 			host->ops->prepare_hs400_tuning(host, &host->ios);
 
-	return mmc_execute_tuning(card);
+	err = mmc_execute_tuning(card);
+	if (err)
+		return err;
+
+	return mmc_select_hs400(card);
 }
 
 /*
@@ -1733,10 +1738,6 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
 		err = mmc_hs200_tuning(card);
 		if (err)
 			goto free_card;
-
-		err = mmc_select_hs400(card);
-		if (err)
-			goto free_card;
 	} else if (!mmc_card_hs400es(card)) {
 		/* Select the desired bus width optionally */
 		err = mmc_select_bus_width(card);
-- 
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux